我正在使用Visual 2015发布一个WPF应用程序。在发布之后,当我单击.application
文件时,它将引发以下错误:
无法安装或运行应用程序。应用程序要求程序集System.Windows.Interactivity版本4.5.0.0首先安装在全局程序集缓存中。
我的应用程序中的System.Windows.Interactivity
版本是4.0.0.0。那么为什么要4.5.0.0呢?我甚至在网上找不到那个版本。
基于这个问题,我更新了我的app.config
,使其具有这样的功能,但没有效果:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
</assemblyBinding>
在Visual的“错误列表”选项卡中,它有以下警告:
发现无法解决的同一依赖程序集的不同版本之间的冲突。当日志详细设置为详细时,这些引用冲突将在构建日志中列出。
我做错了什么?谢谢。
发布于 2016-09-16 12:05:03
显然,MVVM在项目中安装了4.5个版本的System.Windows.Interactivity
,这与4.0版本相冲突。解决方案:
System.Windows.Interactivity
。System.Windows.Interactivity
版本4.5.0.0的框。现在再次发布,安装程序可以正常工作。作为对造成冲突的原因的上述研究的一部分,我为构建生成了一个详细的日志。大约在第2 000行,它包括以下内容:
Unified Dependency "System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". (TaskId:13)
1> Using this version instead of original version "4.0.0.0" in "C:\Users\myUserName\Documents\Visual Studio 2015\Projects\MyProject\packages\Blend.Interctivity.WPF.v4.0.1.0.3\lib\net40\Microsoft.Expression.Interactions.dll" because of a binding redirect entry in the file "App.config". (TaskId:13)
1> Resolved file path is "C:\Users\myUserName\Source\Workspaces\Workspace\packages\MvvmLightLibs.5.2.0.0\lib\net45\System.Windows.Interactivity.dll". (TaskId:13)
1> Reference found at search path location "C:\Users\myUserName\Source\Workspaces\Workspace\packages\MvvmLightLibs.5.2.0.0\lib\net45". (TaskId:13)
1> For SearchPath "C:\Users\myUserName\Source\Workspaces\Workspace\packages\MvvmLightLibs.5.2.0.0\lib\net45". (TaskId:13)
1> Considered "C:\Users\myUserName\Source\Workspaces\Workspace\packages\MvvmLightLibs.5.2.0.0\lib\net45\System.Windows.Interactivity.winmd", but it didn't exist. (TaskId:13)
1> Required by "GalaSoft.MvvmLight.Platform, Version=5.2.0.37226, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL". (TaskId:13)
1> Required by "Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". (TaskId:13)
1> This reference is not "CopyLocal" because it conflicted with another reference with the same name and lost the conflict. (TaskId:13)
1> The ImageRuntimeVersion for this reference is "v4.0.30319". (TaskId:13)
https://stackoverflow.com/questions/39519838
复制相似问题