如何在wpf中重定向程序集版本? [英] How to redirect Assembly Versions in wpf?
问题描述
如何在WPF中重定向程序集版本?
以下 http:// msdn .microsoft.com / en-us / library / 7wd6ex19(v = vs.110).aspx#bypass_PP 引发文件加载异常。
How to redirect Assembly Versions in WPF? Following http://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.110).aspx#bypass_PP throws File Load exception.
无法加载文件或程序集 Microsoft.Practices.Unity,版本= 2.1.505.0,文化=中性,PublicKeyToken = 31bf3856ad364e35或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040)
Could not load file or assembly 'Microsoft.Practices.Unity, Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Unity"
publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<!-- Assembly versions can be redirected in app,
publisher policy, or machine configuration files. -->
<bindingRedirect oldVersion="2.1.505.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
推荐答案
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Unity"
publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<!-- Assembly versions can be redirected in app,
publisher policy, or machine configuration files. -->
<bindingRedirect oldVersion="2.1.505.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration >
这篇关于如何在wpf中重定向程序集版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!