Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using two .NET libraries with the same namespace

Tags:

c#

.net

vb.net

dll

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.

like image 473
cdmckay Avatar asked Dec 14 '22 04:12

cdmckay


1 Answers

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.

like image 59
Samuel Avatar answered Dec 29 '22 14:12

Samuel