Weird behavior when mixing loading of assemblies using Assembly.LoadFrom and Assembly.Load
I have encountered a weird behavior when loading assemblies with Assembly.
That's not weird. As per the documentation, loading with Load and LoadFrom will place the assemblies in different contexts. This might help.
- Any explanation why the CLR ignores the already loaded assembly?
Because they're in a different context.
- Any idea how can I alleviate this problem?
Load from the same context, or help the CLR find the assembly, perhaps by attaching a handler to AppDomain.AssemblyResolve
.
Alternative
If the location you are loading assemblies from is a subfolder under AppDomain.BaseDirectory you can simply add an entry to your App.config:
http://msdn.microsoft.com/en-us/library/823z9h8w.aspx