Wednesday, November 18, 2009

Assembly Binding - Probing

Search Steps :

Determine the right version by using publisher policy file and configuration files

Search Global assembly cache

<CodeBase> defined in policy file overwrite the one defined in configuration file below

<Configuration><Runtime><AssemblyBinding><DependentAssembly><CodeBase> defined in configuration file.The url could be location in the intranet or internet, but the referenced assemply must be strongly named. Otherwise (private assembly) the url must be relative to the application directory.

If culture is included, following folders are searched:
[application base] / [culture] / [assembly name].dll [application base] / [culture] / [assembly name] / [assembly name].dll

Without culture, following folders are searched:
[application base] / [assembly name].dll
[application base] / [assembly name] / [assembly name].dll

<Configuration><Runtime><AssemblyBinding><DependentAssembly><Probing>: semicolon seperated paths below application base defined by AppDomain.CurrentDomain.BaseDirectory. When defined, followng folders are searched:
If culture is included, the following directories are probed:
[application base] / [binpath] / [culture] / [assembly name].dll
[application base] / [binpath] / [culture] / [assembly name] / [assembly name].dll
If culture information is not included, the following directories are probed:
[application base] / [binpath] / [assembly name].dll
[application base] / [binpath] / [assembly name] / [assembly name].dll

If an assembly uses the LoadFrom method to reference another assembly, the calling assembly's location is considered to be a hint about where to find the referenced assembly (this would be in different loading context from above).

No comments:

Post a Comment