Share via


<qualifyAssembly> Element

Specifies the full name of the assembly that should be dynamically loaded when a partial name is used.

<configuration>
   <runtime>
      <assemblyBinding>
         <qualifyAssembly>

<qualifyAssembly partialName="PartialAssemblyName"
                 fullName="FullAssemblyName"/>

Required Attributes

Attribute Description
partialName Specifies the partial name of the assembly as it appears in the code.
fullName Specifies the full name of the assembly as it appears in the global assembly cache.

Remarks

Calling the Assembly.Load method using partial assembly names causes the common language runtime to look for the assembly only in the application base directory. Use the <qualifyAssembly> element in your application configuration file to provide the full assembly information (name, version, public key token, and culture) and cause the common language runtime to search for the assembly in the global assembly cache.

The fullName attribute must include the four fields of assembly identity: name, version, public key token, and culture. The partialName attribute must partially reference an assembly. You must specify at least the assembly's text name (the most common case), but you can also include version, public key token, or culture (or any combination of the four, but not all four). The partialName must match the name specified in your call. For example, you cannot specify "math" as the partialName attribute in your configuration file and call Assembly.Load("math, Version=3.3.3.3") in your code.

Example

The following example logically turns the call Assembly.Load("math") into Assembly.Load("math,version=1.0.0.0,publicKeyToken=a1690a5ea44bab32,culture=neutral").

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <qualifyAssembly partialName="math" 
                         fullName=
"math,version=1.0.0.0,publicKeyToken=a1690a5ea44bab32,culture=neutral"/>
      </assemblyBinding>
   </runtime>
</configuration>

Configuration File

This element can be used in the application configuration file.

See Also

Runtime Settings Schema | How the Runtime Locates Assemblies | Partial Assembly References