解决一个项目里面加载两个同名不同版本的DLL的问题
2017-06-27 11:04 杨新华 阅读(1306) 评论(0) 编辑 收藏 举报在config里面这样配置,可以加载不同版本的dll
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Practices.Prism.MefExtensions" culture="neutral" publicKeyToken="31bf3856ad364e35"></assemblyIdentity> <codeBase version="4.0.0.0" href="inms\Microsoft.Practices.Prism.MefExtensions.dll"></codeBase> <codeBase version="5.0.0.0" href="gip\Microsoft.Practices.Prism.MefExtensions.dll"></codeBase> </dependentAssembly> </assemblyBinding> </runtime>
下面的配置,可以指定旧的版本引用全部指向新版本
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.Practices.Prism.MefExtensions" culture="neutral" publicKeyToken="31bf3856ad364e35"></assemblyIdentity> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"></bindingRedirect> </dependentAssembly> </assemblyBinding> </runtime>