让你的.NET程序兼容不同版本的Dll文件
来源:岁月联盟
时间:2005-03-23
后来查了一下MSDN,发现只要在config里面加入runtime节点就可以了。
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MyAssembly"
publicKeyToken="2b7c3a3291de04"
culture="neutral" />
<bindingRedirect oldVersion="3.0.0.8"
newVersion="4.1.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
不过这有个前提条件就是这两个DLL的PublicKeyToken是一样的,就是需要用同一个sn文件签名的才行。
当然如果你的库文件根本就没有用Strong Name签名的话,就不用考虑版本问题了。