在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>