The application configuration file can be used to point directly to the file containing a particular assembly’s manifest. This prevents the AssemblyResolver from probing for it under the AppBase. For example, the following entry tells the AssemblyResolver that version 1.0.0.1 of calcr can be found at http://internaltools/utils/caclr.dll :
<Assemblies> <CodeBaseHint Name="Calcr" Originator="8e47bf1a5ed0ec84" Version="1.0.0.1" CodeBase="http://internaltools/utils/caclr.dll"/> </Assemblies>
When the file at the given codebase is loaded, the AssemblyResolver checks to be sure that the name, version, culture and Originator match what is in the reference. Of course, by default the revision and build numbers can be higher that what is requested. Regardless of whether the given assembly matches the bind criteria, Step 3 is done at this point. If no match is found, the bind fails – no further steps are taken. If we do have a match, we proceed to Step 4.
In some scenarios, codebase information may also be available in the current binding context. This most often applies in the browser download scenario. Given an assembly that references another assembly, the first assembly’s codebase is considered a “hint” as to where to find the referenced assembly. For example, if Asm1 references Asm2 and Asm1 were downloaded from http://mystuff/utils then http://mystuff/utils will be considered a hint as to where to find Asm2.dll. If Asm2 is not found at that location, the AssemblyResolver will continue by probing for the assembly as described below.