2010-04-26 76 views
1

我正在运行VS 2010以及Expression Blend 4测试版。我从提供的模板中创建了一个MVVM Light项目,当我尝试在VS 2010设计器窗口中查看MainWindow.Xaml时,出现System.IO.FileLoadException。该模板已经引用System.Windows.Interactivity。以下是异常的详细信息:试图从中会造成大会在.NET Framework的早期版本中被沙盒的网络位置加载程序集MVVM Light Toolkit引发System.IO.FileLoadException

System.IO.FileLoadException 
Could not load file or assembly 'System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) 
    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.Assembly.Load(AssemblyName assemblyRef) 
    at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.VsReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) 
    at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.CachingReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) 
    at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.Microsoft.Windows.Design.Metadata.IReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) 
    at MS.Internal.Metadata.ClrAssembly.GetRuntimeMetadata(Object reflectionMetadata) 
    at Microsoft.Windows.Design.Metadata.AttributeTableContainer.<MergeAttributesIterator>d__c.MoveNext() 
    at Microsoft.Windows.Design.Metadata.AttributeTableContainer.GetAttributes(Assembly assembly, Type attributeType, Func`2 reflectionMapper) 
    at MS.Internal.Metadata.ClrAssembly.GetAttributes(ITypeMetadata attributeType) 
    at MS.Internal.Design.Metadata.Xaml.XamlAssembly.get_XmlNamespaceCompatibilityMappings() 
    at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata sourceAssembly) 
    at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensions.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata source) 
    at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption() 
    at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier) 
    at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context) 
    at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider) 
    at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors) 
    at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem() 
    at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem() 
    at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState() 
    at MS.Internal.Host.PersistenceSubsystem.Load() 
    at MS.Internal.Host.Designer.Load() 
    at MS.Internal.Designer.VSDesigner.Load() 
    at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() 
    at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view) 
    at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) 
    at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) 
    at MS.Internal.Host.Isolation.IsolatedDesigner.Load() 
    at MS.Internal.Designer.DesignerPane.LoadDesignerView() 

System.NotSupportedException 。此版本的.NET Framework默认情况下不启用CAS策略,因此此加载可能很危险。如果此加载不是为了装配沙盒,请启用loadFromRemoteSources开关。有关更多信息,请参阅http://go.microsoft.com/fwlink/?LinkId=155569

回答

0

如果仍然不工作,你做了什么@LBugnion告诉做。那么这是预测,因为你从网络位置运行项目。尝试将项目复制到loval驱动器(可能是您的桌面)。现在它正在工作:D