2010-04-26 149 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