kateroh
kateroh

Reputation: 4416

Adding dependencies to C# project - same assemblies of different versions

I need to be able to call utilities from different versions of the same assembly both residing in GAC:

gacutil /l TestAssembly  
  TestAssembly.dll, Version=1.0.0.0 ....  
  TestAssembly.dll, Version=2.0.0.0 ....  

And somewhere in code I need to dynamically load either one:

TestObject testObject;
if (loadFromVersion1)  
{  
    testObject = // instantiate test object from the first assembly  
}  
else  
{  
    testObject = // instantiate test object from the second assembly  
}  

Is there a way to do this without reflection (i know how to accomplish this with reflection) and use strongly typed objects instead?

Upvotes: 0

Views: 608

Answers (1)

GBegen
GBegen

Reputation: 6157

I think you are looking for extern alias.

Upvotes: 1

Related Questions