I use the following code:
Assembly.LoadFile("the assembly in another folder");
var type = Type.GetType("the full name of the type");
Even though the assembly was already loaded before this line of code, it always returns null in type.
PS: I did pass in the assembly qualified name, including namespace, type name, assembly name, version and public token.
Type.GetTypeonly searches the types in the calling assembly and the types in mscorlib.dll unless you pass the assembly qualified name of the type. See here.EDIT
It appears that
Type.GetTypeis only able to retrieveTypeinstances from assemblies in the Load context. Assemblies loaded usingLoadFileare in no context and those loaded usingLoadFromare in the Load From context; neither of these contexts allow you to useType.GetTypeso the resolution will fail. This article shows thatTypeinformation can be retrieved for anAssemblywhen the directory it is in is added as a probing privatePath since it will then end up in the Load context but will fail in other contexts.