Imagine this scenario:
var ass1 = Assembly.LoadFrom(@"C:\Work\3.59\assembly1.dll");
var ass2 = Assembly.LoadFrom(@"C:\Work\3.60\assembly1.dll");
Debug.Assert(ass1 != ass2);
The above assert fails. It seems the second call returns the first assembly even if the two assemblies above have different versions and locations.
The assemblies are not stong-named and can’t be signed.
Is there a way to force the framework to load them in the same context and domain?
Use
Assembly.LoadFile(path)instead.From MSDN
From CLR developer Suzanne Cook’s blog: