在同一文件夹中使用同一程序集的不同版本 [英] Using different versions of the same assembly in the same folder

查看:81
本文介绍了在同一文件夹中使用同一程序集的不同版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下情况

项目A

 - Uses Castle Windsor v2.2
 - Uses Project B via WindsorContainer

项目B

 - Uses NHibernate
 - Uses Castle Windsor v2.1

在项目A的bin文件夹中,我有dll Castle.DynamicProxy2.dll v2.2和NHibernate dll.现在的问题是NHibernate依赖于不存在的Castle.DynamicProxy2.dll v2.1.我该如何解决这种情况.

In the bin folder of Project A I have the dll Castle.DynamicProxy2.dll v2.2 and NHibernate dlls. Now the problem is that NHibernate is dependent on Castle.DynamicProxy2.dll v2.1 which is not there. How do I resolve this situation.

推荐答案

我使用以下配置解决了该问题.

I used the following configuration to resolve the issue.

<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Castle.DynamicProxy2" publicKeyToken="407dd0808d44fbdc" />
                <codeBase version="2.1.0.0" href="v2.1\Castle.DynamicProxy2.dll" />
                <codeBase version="2.2.0.0" href="v2.2\Castle.DynamicProxy2.dll" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" />
                <codeBase version="1.1.0.0" href="v2.1\Castle.Core.dll" />
                <codeBase version="1.2.0.0" href="v2.2\Castle.Core.dll" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

这篇关于在同一文件夹中使用同一程序集的不同版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆