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



The information in this article applies to:

  • Microsoft Common Language Runtime (included with the .NET Framework) 1.0
  • Microsoft Internet Explorer 6.0 Service Pack 1

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.

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.

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>

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.

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.

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:


Modification Type:MajorLast Reviewed:6/5/2003
Keywords:kbprb KB814668 kbAudDeveloper