使用两个具有相同命名空间的.NET库 [英] Using two .NET libraries with the same namespace
问题描述
不幸的是,Lib2不能向后兼容Lib1。更糟糕的是,他们都使用相同的命名空间Product.Common。
如何在同一个项目中使用Lib2和Lib1?现在,如果我添加对它们的引用,VS会告诉我某些类是不明确的(这是有道理的,因为它们使用相同的命名空间)。
基本上,我需要这样的东西:
导入Lib1:Product.Common.Class
我正在使用VB.NET 1.1。
发现一个博客条目在C#中有一个解决方案,不知道在VB.NET中的解决方案。
Extern别名演练
和
C#2.0:在一个应用程序中使用不同版本的同一个DLL
编辑:
似乎你没有运气。似乎没有.NET 1.1的解决方案。
I'm currently maintaining some old code for a company. As it would happen, the current app I'm modifying uses an older version of the in-house library (we'll call this Lib1.dll). They also have a new version of the library called Lib2.dll that improves upon the previous library in many ways.
Unfortunately, Lib2 is not backward compatible with Lib1. What's worse is that they both use the same namespace Product.Common.
How do I use Lib2 and Lib1 in the same project? Right now if I add references to both of them, VS tells me that certain classes are ambiguous (which makes sense, since they using the same namespace).
Basically, I need something like:
Imports Lib1:Product.Common.Class
I'm using VB.NET 1.1.
I found a blog entry that has a solution in C#, not sure of the solution in VB.NET.
Extern alias walkthrough and C# 2.0: Using different versions of the same dll in one application
Edit:
It would seem you are out of luck. There does not appear to be a solution with .NET 1.1.
这篇关于使用两个具有相同命名空间的.NET库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!