Thanks for updating your post. This single line shows why you are encountering this behavior.
The method LoadFrom
works as defined:
The load-from context contains assemblies for which the user provided
a path not included in the directories searched by probing. LoadFrom,
CreateInstanceFrom, and ExecuteAssembly are examples of methods that
load by path.
Probing is the process of looking in the GAC, the host assembly store, the folder of the executing assembly, or the private folder of the executing assembly to find the assembly.
As you already referenced the assembly, it just returns the already-loaded assembly that match with the name you supplied in parameter.
The method you are looking for is LoadFile
. MSDN states the following:
Use the LoadFile method to load and examine assemblies that have the
same identity, but are located in different paths. LoadFile does not
load files into the LoadFrom context, and does not resolve
dependencies using the load path, as the LoadFrom method does.
Additional resources
LoadFile vs. LoadFrom written by Suzanne Cook on her blog .NET CLR Notes.
Be careful - these aren't the same thing.
LoadFrom() goes through Fusion and can be redirected to another assembly at a different path but with that same identity if one is
already loaded in the LoadFrom context.
LoadFile() doesn't bind through Fusion at all - the loader just goes ahead and loads exactly* what the caller requested. It doesn't
use either the Load or the LoadFrom context.
So, LoadFrom() usually gives you what you asked for, but not
necessarily. LoadFile() is for those who really, really want exactly
what is requested. (*However, starting in v2, policy will be applied
to both LoadFrom() and LoadFile(), so LoadFile() won't necessarily be
exactly what was requested. Also, starting in v2, if an assembly with
its identity is in the GAC, the GAC copy will be used instead. Use
ReflectionOnlyLoadFrom() to load exactly what you want - but, note
that assemblies loaded that way can't be executed.)
LoadFile() has a catch. Since it doesn't use a binding context, its
dependencies aren't automatically found in its directory. If they
aren't available in the Load context, you would have to subscribe to
the AssemblyResolve event in order to bind to them.