Compiling CUI under Visual Studio 2010

Nov 12, 2009 at 2:10 AM

With a few easy steps you can compile the Microsoft Health Common User Interface under VS2010.

The details are on the following blog:

http://www.global-webnet.net/blogengine/post/2009/11/11/Migrating-CUI-from-VS2008-to-VS2010.aspx

Nov 17, 2009 at 8:13 AM

hi Bill

Thanks for your post. I'll forward your link to our deployment team.

Regards

Tom Chapman

MSCUI Release Manager

Sep 27, 2010 at 9:16 PM

Hi Billkrat,

I have been following your hints and tips but I cant get it through the compile step. I am stuck with 11 errors and 527 warnings. My environment is VS 2010 and Framework vs. 4.0. The handicap I have, is that originally I am a VB developer, so I have trouble figuring out the syntax for C# to correct it.

Hope you can help me?

Here is the list of errors I get after an attempt to compile:

Error 25 Warning as Error: 'System.Security.Permissions.SecurityAction.RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.' C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Common\CommonAssemblyInfo.cs 37 26 Microsoft.Cui.ServicesSample
Error 26 Warning as Error: 'System.Security.Permissions.SecurityAction.RequestOptional' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.' C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Common\CommonAssemblyInfo.cs 38 26 Microsoft.Cui.ServicesSample
Error 27 The extern alias 'Silverlight' was not specified in a /reference option C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.Controls.Design\MetadataRegistrationBase.cs 27 5 Microsoft.Cui.Controls.Design
Error 35 The type name 'Rss20FeedFormatter' could not be found. This type has been forwarded to assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.SampleWebsite\Default.aspx.cs 65 13 Microsoft.Cui.SampleWebsite
Error 36 The type name 'Rss20FeedFormatter' could not be found. This type has been forwarded to assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.SampleWebsite\Default.aspx.cs 65 42 Microsoft.Cui.SampleWebsite
Error 37 The type name 'SyndicationItem' could not be found. This type has been forwarded to assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.SampleWebsite\Default.aspx.cs 73 21 Microsoft.Cui.SampleWebsite
Error 38 The type name 'SyndicationItem' could not be found. This type has been forwarded to assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.SampleWebsite\Default.aspx.cs 74 49 Microsoft.Cui.SampleWebsite
Error 39 The extern alias 'Silverlight' was not specified in a /reference option C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.Controls.Design\MetadataRegistrationBase.cs 27 5 Microsoft.Cui.Controls.VisualStudio.Design
Error 40 The "ValidateXaml" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\ReferencedAssemblies\SilverlightToolkit\System.Windows.Controls.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\ReferencedAssemblies\SilverlightToolkit\System.Windows.Controls.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

 Microsoft.Cui.Controls
Error 44 The extern alias 'Silverlight' was not specified in a /reference option C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.Controls.Expression.Design\MetadataRegistrationBlendBase.cs 27 5 Microsoft.Cui.Controls.Expression.Design
Error 535 The "ValidateXaml" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\ReferencedAssemblies\SilverlightToolkit\System.Windows.Controls.Toolkit.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\ReferencedAssemblies\SilverlightToolkit\System.Windows.Controls.Toolkit.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

 Microsoft.Cui.SamplePages

 

Sep 28, 2010 at 11:56 PM

I’d help you get through this but we are packing and getting ready to leave for vacation.

One thing I’m seeing is that errors are being treated as warnings – there is a project setting for this;  it has been a long time since I dinked with this but you may be  required to list the error numbers delimited, e.g., 25, 26, etc.  Hope this gets you started!   

From: PeterKlein [mailto:notifications@codeplex.com]
Sent: Monday, September 27, 2010 5:16 PM
To: bill@global-webnet.com
Subject: Re: Compiling CUI under Visual Studio 2010 [mscui:74852]

From: PeterKlein

Hi Billkrat,

I have been following your hints and tips but I cant get it through the compile step. I am stuck with 11 errors and 527 warnings. My environment is VS 2010 and Framework vs. 4.0. The handicap I have, is that originally I am a VB developer, so I have trouble figuring out the syntax for C# to correct it.

Hope you can help me?

Here is the list of errors I get after an attempt to compile:

Error 25 Warning as Error: 'System.Security.Permissions.SecurityAction.RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.' C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Common\CommonAssemblyInfo.cs 37 26 Microsoft.Cui.ServicesSample
Error 26 Warning as Error: 'System.Security.Permissions.SecurityAction.RequestOptional' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.' C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Common\CommonAssemblyInfo.cs 38 26 Microsoft.Cui.ServicesSample
Error 27 The extern alias 'Silverlight' was not specified in a /reference option C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.Controls.Design\MetadataRegistrationBase.cs 27 5 Microsoft.Cui.Controls.Design
Error 35 The type name 'Rss20FeedFormatter' could not be found. This type has been forwarded to assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.SampleWebsite\Default.aspx.cs 65 13 Microsoft.Cui.SampleWebsite
Error 36 The type name 'Rss20FeedFormatter' could not be found. This type has been forwarded to assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.SampleWebsite\Default.aspx.cs 65 42 Microsoft.Cui.SampleWebsite
Error 37 The type name 'SyndicationItem' could not be found. This type has been forwarded to assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.SampleWebsite\Default.aspx.cs 73 21 Microsoft.Cui.SampleWebsite
Error 38 The type name 'SyndicationItem' could not be found. This type has been forwarded to assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.SampleWebsite\Default.aspx.cs 74 49 Microsoft.Cui.SampleWebsite
Error 39 The extern alias 'Silverlight' was not specified in a /reference option C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.Controls.Design\MetadataRegistrationBase.cs 27 5 Microsoft.Cui.Controls.VisualStudio.Design
Error 40 The "ValidateXaml" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\ReferencedAssemblies\SilverlightToolkit\System.Windows.Controls.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\ReferencedAssemblies\SilverlightToolkit\System.Windows.Controls.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
at Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

Microsoft.Cui.Controls
Error 44 The extern alias 'Silverlight' was not specified in a /reference option C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\Solutions\Main\Microsoft.Cui.Controls.Expression.Design\MetadataRegistrationBlendBase.cs 27 5 Microsoft.Cui.Controls.Expression.Design
Error 535 The "ValidateXaml" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\ReferencedAssemblies\SilverlightToolkit\System.Windows.Controls.Toolkit.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Peter Klein\Downloads\Microsoft.Cui\Source\ReferencedAssemblies\SilverlightToolkit\System.Windows.Controls.Toolkit.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
at Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

Microsoft.Cui.SamplePages

Read the full discussion online.

To add a post to this discussion, reply to this email (mscui@discussions.codeplex.com)

To start a new discussion for this project, email mscui@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Jan 26, 2011 at 3:07 PM

@PeterKlein: Hi. I was having the same troubles. It turned out I was trying to compile with the .NET 4.0 Framework. Set that to 3.5 and all warnings and errors should disappear.

Jan 26, 2011 at 5:44 PM

@gianluca_c: thanks for your suggestion. At the moment I'm very busy working on another healthcare project, but I will certainly give it a try and let you know the results!