【发布时间】:2013-03-28 10:35:46
【问题描述】:
我有 2 个程序集,我们分别称它们为 A 和 B。我已经为它们分配了强名称,现在问题出现了,程序集 B 正在寻找旧版本的程序集 A。 ** EDIT2:如果我删除 AssemblyB 问题仍然存在,那么它可能只是 VS2008 正在寻找旧版本?同样通过 fusionlog 我看到以下警告:wrn application configuration file binding redirects disallowed。这有什么关系吗? **
我收到多个相同类型的错误,这是一个 sn-p:
You must add a reference to assembly 'AssemblyA, Version=1.2.4737.25316, Culture=neutral, PublicKeyToken=null'.
项目中的强命名 AssemblyA 显示以下属性:
我在 app.config 中放置了这段代码:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="AssemblyA" culture="neutral"
publicKeyToken="a22e30ac6a0edfc0"/>
<bindingRedirect oldVersion="1.2.4737.25316" newVersion="1.3.0.19440"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
但这不起作用。我可以访问这两个程序集的源代码。
编辑:如果我删除强命名并将旧(弱命名)dll 添加到项目中,它将给出一个错误,询问强命名版本
You must add a reference to assembly 'AssemblyA, Version=1.3.0.19440, Culture=neutral, PublicKeyToken=a22e30ac6a0edfc0'.
这里发生了什么?
【问题讨论】:
标签: c# assemblies .net-assembly