I plan to load an assembly during application startup, and load that
assembly via reflection (i.e., it isn't referenced in the application's
assembly manifest). The assembly will be loaded into the application's
default app domain, with code like this:
using System.Reflection;
Assembly loadedAssembly = Assembly.LoadFile(pathToMyAssembly);
My question: When I need to access members of the assembly [loaded via
reflection], how does the application know to get the member from the
dynamically loaded assembly [that is already loaded]? Am I required to get a
runtime reference to that dynamically loaded assembly? and execute GetType()
on that assembly reference?
Or will the Framework attempt to locate the assembly by first looking into
the current app domain before going to the assembly manifest to try to load
the assembly?
I have read up on assembly binding and probing rules and heuristics, but
what I have read assumes that the assembly is listed in the application's
assembly manifest... looks there, then goes through the normal probing
sequence. Is it possible that I've missed something ? and that the "normal
probing sequence" actually starts with the application's default application
domain and uses any loaded assembly before searching the GAC, /bin,
<probinglocations, etc?
Thanks.