Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: Runtime Probe Causes a Delay When You Load a Windows Forms Control in Internet Explorer


View products that this article applies to.

Symptoms

After you download a managed assembly (a DLL or an .exe file) to the client and then locate it in Internet Explorer, you experience a delay in the time it takes Internet Explorer to display the managed assembly. The assembly itself is not downloaded again.

↑ Back to the top


Cause

You experience this behavior only if you do not provide a <codeBase> element hint (for example, a URL to a source location) to bind to the assembly. If you do not know the <codeBase>, the runtime uses its own heuristics to try to find the assembly.

↑ Back to the top


Resolution

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>

↑ Back to the top


Status

This is an issue in the common language runtime environment that is included with the .NET Framework 1.0. This behavior is by design.

↑ Back to the top


More information

To turn off application configuration mapping for .config file extensions, follow these steps :
  1. Click Start, point to Programs, point to Administrative Tools, and then click Internet Information Services.
  2. Right-click Default Web site, and then click Properties.
  3. On the Home directory tab, click Configuration.
  4. In the Application Configuration window, click Application Mapping for the .config extension, and then click Remove.

↑ Back to the top


References

For additional information about how common language runtime locates assemblies, click the following article number to view the article in the Microsoft Knowledge Base:
315160� BUG: The "Classid" Attribute of the Windows User Control in an &lt;Object&gt; Tag Is Case Sensitive

For more information about how common language runtime locates and binds assemblies, visit the following Microsoft Developer Network Web site:

↑ Back to the top


Keywords: KB814668, kbprb

↑ Back to the top

Article Info
Article ID : 814668
Revision : 2
Created on : 6/5/2003
Published on : 6/5/2003
Exists online : False
Views : 465