My problem: I have an assembly in 2 versions and want to use them at the same time in my Python project.
The .NET libs are installed in GAC (MSIL), having the same public token:
lib.dll (1.0.0.0)
lib.dll (2.0.0.0)
In Python I want something like that:
import clr
clr.AddReference("lib, Version=1.0.0.0, ...")
from lib import Class
myClass1 = Class()
myClass1.Operation()
*magic*
clr.AddReference("lib, Version=2.0.0.0, ...")
from lib import class
myClass2 = Class()
myClass2.Operation()
myClass2.OperationFromVersion2()
*other stuff*
# both objects should be accessibly
myClass1.Operation()
myClass2.OperationFromVersion2()
Is there a way to do that? Something with AppDomains or bindingRedirect?
Note: Of course myClass1.operationFromVersion2() can fail...