I have a project where I need to use a reference with different versions in a single execution, for example:
Switch the System.Drawing version 2.0.0 reference to System.Drawing version 1.0.0
Is it possible to do this?
I have a project where I need to use a reference with different versions in a single execution, for example:
Switch the System.Drawing version 2.0.0 reference to System.Drawing version 1.0.0
Is it possible to do this?
It is possible through a dynamic invocation of the assembly:
// caminho da DLL antiga
var assembly = Assembly.LoadFile("caminho");
// tipo da classe desejada
dynamic instancia = assembly.CreateInstance("tipo");
// chamar o método que está procurando ou fazer o que precisar com a variável
instancia.MetodoDesejado();