PRB: "FileLoadException" Error Message When the .NET Runtime Searches for Assemblies by Using the Probing Tag of the Application Configuration File (821626)
The information in this article applies to:
- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.0
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSAssume the following: - An application references an assembly.
- The assembly has multiple versions.
- The assembly is located in a directory that the privatePath attribute of the probing tag specifies in the application configuration file.
When you run this application, you may receive the
following System.IO.FileLoadException error message: The located assembly's manifest
definition with the name imported type instance does not match the assembly reference. CAUSEThis problem occurs when the runtime probes for references to
an assembly. The probing feature stops when the probe locates an assembly that has the following characteristics: - The assembly has the specified name.
- The assembly is located in a directory that the privatePath attribute of the probing tag specifies in the application configuration file.
The runtime
probes for references to
the assembly in the directories that the privatePath attribute specifies. The runtime searches these directories in the order that they appear in the value of the privatePath attribute. During this probe, the runtime does not verify the
version, the public key token, or the culture of the assembly. The runtime probes only for the assembly name. RESOLUTIONTo resolve this problem, modify the application configuration
file to use the codeBase tag instead of the probing tag. The following is a sample of the modified configuration information: <configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="server" publicKeyToken="ae13fa4a5de1ffac" />
<codeBase version="1.0.0.0" href="v1/server.dll"/>
<codeBase version="2.0.0.0" href="v2/server.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> Note You can locate the value of the publicKeyToken attribute of Server.dll by running the following command at a command prompt: The output of this command contains a value named 'Public key token'. Use this value for the value of the publicKeyToken attribute of the assemblyIdentity tag in the application configuration file. STATUS This
behavior is by design.
REFERENCESFor more information about how the runtime locates
assemblies, visit the following Microsoft Web site: For
more information about the probing tag and the codeBase tag in the runtime settings schema for configuration files,
visit the following Microsoft Web site:
Modification Type: | Major | Last Reviewed: | 6/6/2003 |
---|
Keywords: | kberrmsg kbSchema kbConfig kbAppSetup kbprb KB821626 kbAudDeveloper |
---|
|