我有两个版本的dll。 我看到了一个意外的行为。 当我将程序集重定向添加到web.config时,它可以正常工作,但是当它在machine.config中添加时,我的应用程序内部会因加载旧版本的库而出现一些错误。 我不知道为什么会发生这种情况。
怎么回事?
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="My.Library" publicKeyToken="..removed in stackoverflow...." culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
答案 0 :(得分:0)
<runtime/>
在machine.config中重复。小心那个它不会抛出异常。