MVVM Light Toolkit создает исключение System.IO.FileLoadException - PullRequest
1 голос
/ 26 апреля 2010

Я использую VS 2010 вместе с Expression Blend 4 beta. Я создал проект MVVM Light из предоставленных шаблонов и получаю исключение System.IO.FileLoadException при попытке просмотреть MainWindow.Xaml в окне дизайнера VS 2010 Шаблон уже ссылается на System.Windows.Interactivity. Вот подробности исключения:

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. Этот выпуск .NET Framework по умолчанию не включает политику CAS, поэтому эта загрузка может быть опасной. Если эта загрузка не предназначена для песочницы сборки, включите переключатель loadFromRemoteSources. См. http://go.microsoft.com/fwlink/?LinkId=155569 для получения дополнительной информации.

Ответы [ 2 ]

4 голосов
/ 30 апреля 2010

Да, проблема в том, что перед установкой zip-файлы необходимо разблокировать.

См http://www.galasoft.ch/mvvm/installing/manually/#unblock

После того, как вы разблокируете zip-файл, вы можете установить поверх существующих DLL-файлов, они будут перезаписаны с правильной версией.

Привет, Laurent

0 голосов
/ 19 января 2012

Если это все еще не работает, и вы сделали то, что говорит @LBugnion. Тогда это пропалия, потому что вы запускаете проект из сетевого расположения. Попробуйте скопировать проект на любимый диск (это может быть ваш рабочий стол). Теперь это должно работать: D

...