You can remove the additional probe when you specify a
<codeBase> hint for the assembly in the configuration file of your
application. Common language runtime always checks the codebase before it
probes for the referenced assembly. A sample configuration file follows:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MyControl" />
<codeBase href="http://localhost/MyControl/bin/Debug/MyControl.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
For managed executables, the application configuration file resides in
the same folder as the executable file. It also has the same base name as the
executable with a .config extension. For example, the configuration file for
Myapp.exe is
Myapp.exe.config.
Note Because of security issues, this usage has an important
limitation. If you install ASP.NET on computers running Microsoft Internet
Information Services (IIS), IIS does not serve files with .config extensions
for security reasons. You must turn off application configuration mapping for
.config file extensions in IIS. This is no longer necessary if you install the .NET Framework 1.1.
Important When you turn off application configuration mapping, you open a
security hole.
See the "More Information" section of this article for
steps to turn off application configuration mapping.
For a Web page
that uses object tags to host the managed assembly DLL, the Web page must use
the
<link> element to explicitly point to the configuration file. You can
name the configuration file for Web pages that host the managed assembly
anything, for example,
Myapp.myconfig. The following
example shows the HTML code for the Web page that hosts the managed assembly.
<html>
<head>
<!--Reference to the configuration file. -->
<link rel="Configuration" href="http://localhost/MyControl/myapp.myconfig">
</head>
<body>
<object id="MyControl" width=100 height=100 classid="http://localhost/MyControl/bin/Debug/MyControl.dll#MyControl.UserControl1">
</object>
<! -- Put the rest of the HTML code here. -->
</body>
</html>