When the CLR loads your assembly for execution, it checks the assembly manifest to determine which dependencies are needed to run it. To do this, follow a series of steps:
Check redirects . If the assembly has a strong name, the CLR will first check the appropriate configuration ( app.config , web.config , etc.) to see if there are any specified binding redirects. Binding redirection allows the CLR to tell where I should download v1.0.0.0, and instead download v2.0.0.0. If no binding redirection is found for the strongly named assembly, it checks the policy file in the GAC, and if the policy file is not found, it checks machine.config . If no binding redirection is specified, the CLR will use the assembly name specified in the manifest of the calling assembly to load the assembly.
Make sure the assembly is already loaded . The CLR determines whether the assembly was previously loaded, if it is, it uses the same loaded assembly, otherwise it will continue ...
Download the assembly from the GAC . If the assembly has not been preloaded and strongly named, the CLR will attempt to load the assembly from the global assembly cache.
CodeBase If the CLR still cannot find the assembly, it will use the codeBase path to try to find the assembly.
Research . If the CLR still cannot find the assembly, it will check the discovery path for the assembly. The default verification path is the AppDomain application database path to which assemblies are currently loaded.
(All of this is adapted from a large article entitled Understanding .Net Assemblies and References ).
In the case of your web application, the CLR still does the above, but the base path of the AppDomain is the /bin in your IIS application.
Matthew abbott
source share