Reputation: 2230
When .NET needs to load an assembly, what is the folder hierarchy that it uses to search for the assembly? I assume it starts with the GAC, and then local folder of the executing assembly? What is the complete hierarchy? I know the Windows search path (for unmanaged code) is something like local folder/System32 folder/search path/etc. and I am looking for something similar for .NET.
Upvotes: 4
Views: 356
Reputation: 32851
If you were looking for a description of the process rather than links to lengthy MSDN articles, this is a brief summary of the steps. You can find more details here.
Steps the runtime follows to resolve an assembly reference:
Probes for the assembly by following these steps:
a) If configuration and publisher policy do not affect the original reference and if the bind request was created using the Assembly.LoadFrom method, the runtime checks for location hints.
b) If a codebase is found in the configuration files, the runtime checks only this location.
c) Probes for the assembly using the heuristics described in the probing section. If the assembly is not found after probing, the runtime requests the Windows Installer to provide the assembly. This acts as an install-on-demand feature.
Upvotes: 4
Reputation: 190976
Here are a few articles from MSDN:
Upvotes: 1
Reputation: 52528
Look at this article How the runtime locates assemblies.
It's actually not a linear path, and it depends on a lot (is the assembly loaded already, configuration files, ...) but the article is very clear.
Upvotes: 0