可我的.net应用程序引用两个不同版本的.NET框架库? [英] Can my .Net app reference two different versions of a .net framework library?

查看:439
本文介绍了可我的.net应用程序引用两个不同版本的.NET框架库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有两个项目,P4和P3,分别打靶.NET 4.0和3.5。

Say I have two projects, P4 and P3, targetting .net 4.0 and 3.5 respectively.

每个项目还引用了System.Data这。 在P4的情况下,这将是对System.Data这V4.0.0.0 在P3的情况下,这将是对System.Data这V2.0.0.0

Each project also has a reference to System.Data. In the case of P4, it will be to System.Data v4.0.0.0 In the case of P3, it will be to System.Data v2.0.0.0

项目P4还引用P3。

如果P4被加载并执行时,它使用.NET 4.0 CLR。在运行时,引用System.Data这似乎决心V4.0两个P4和P3内。我可以用assemblyBinding重定向重写此,但随后双方P4和P3决心V2.0。

If P4 is loaded and executed, it uses the .net 4.0 CLR. At runtime, references to System.Data seem to resolve to v4.0 inside both P4 and P3. I can override this by using assemblyBinding redirects, but then both P4 and P3 resolve to v2.0.

有什么办法,我可以配置我的应用程序,以便P4采用V4.0和P3采用2.0?

Is there any way I can configure my application so that P4 uses v4.0 and P3 uses v2.0?

推荐答案

有一个看看这个:的在进程侧并排这可能是一些帮助。

Have a look at this : In-Process Side-by-Side It might be of some help.

这篇关于可我的.net应用程序引用两个不同版本的.NET框架库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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