How Does .NET Locate an Assembly?

There are three separate procedures for locating an assembly:

  • Examining a configuration file

  • Probing

  • Using a Codebase

The application calls a referenced assembly containing information about the assembly, for example, Name, Version, Culture, and Public Key. First, it examines a configuration file. You can update your assembly by creating a configuration file that looks something like this:

<AssemblyBinding xmlns = "urn:schemas-microsoft-com:asm.v1">
<AssemblyIdentity name="IFCE"
<publicKeyToken = "6cf7280fa2c8aa7"/>
<bindingRedirect oldVersion = "" new version = ""/>
<publisherPolicy apply="yes"/>
<probing privatePath="C:\Visual Studio Solutions\IFCE"/>
<gcCurrent enable="true">

Another tool, mscoref.msc, manages and configures the assembly. Its location is C:\Visual Solutions\Microsoft.Net\Framework\.


You must have a client application before you can employ mscoref.msc.

Probing means the runtime looks for the assembly using the following search criteria: The runtime examines the GAC for the assembly’s strong name. If the assembly is private, the runtime searches the application root directory, called the APPBase. If it sees a reference for an assembly, it searches for your DLL. If the assembly is not an APPBase, the runtime alternately searches the configuration file for any specified path. It the assembly is not there, it searches the bin directory.

A <codeBase> element specifies where the CLR can locate your assembly. The runtime uses a configuration file only if the file contains a Redirect Assembly version. After the CLR determines the appropriate version to load, the runtime applies the codebase setting from the file specifying the assembly’s version. Here is an example:

<assemblyBinding = "urn:schemas-Microsoft-com:asm.v1">
<dependentAssembly name ="IFCE Process"
PublicKeyToken = "6cf7280fa2c28aa9"
Culture = "en-us"/>
<codeBase version=""


Codebase is available for use in an application configuration file, machine configuration file (for example, machine.config), and the publisher policy file.

.NET & J2EE Interoperability
Microsoft .NET and J2EE Interoperability Toolkit (Pro-Developer)
ISBN: 0735619220
EAN: 2147483647
Year: 2004
Pages: 101
Authors: Simon Guest © 2008-2017.
If you may any questions please contact us: