Microsoft KB Archive/909641

= You receive a &quot;Page cannot be displayed&quot; error message when you use an ASP.NET application to open an .htm file or another static file that is hosted in IIS 6.0 =

Article ID: 909641

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft .NET Framework 2.0

-





SYMPTOMS
Consider the following scenario:
 * Microsoft Internet Information Services (IIS) 6.0 is running on a Microsoft Windows Server 2003-based computer.
 * You have an existing Microsoft ASP.NET application that is running on the Microsoft .NET Framework 1.1 or on the Microsoft .NET Framework 1.0.
 * This application is mapped to the corresponding .NET Framework 1.1 Aspnet_isapi.dll file or to the corresponding .NET Framework 1.0 Aspnet_isapi.dll file in IIS 6.0.
 * You install the Microsoft .NET Framework 2.0.
 * You modify the ASP.NET application to use the .NET Framework 2.0, and then map the ASP.NET application to Aspnet_isapi.dll file in the .NET Framework 2.0.

In this scenario, you may receive an error message that is similar to the following when you use the ASP.NET application to open an .htm file or another static file that is hosted in IIS 6.0:

&quot;The page cannot be displayed&quot;



CAUSE
This issue occurs when a corresponding mapping for the file name extension does not exist in the ASP.NET HTTP handlers configuration.

Note This issue does not occur if the Aspnet_isapi.dll file is configured as a wildcard application map in IIS 6.0.



WORKAROUND
To work around this issue, use one of the following methods.

Method 1: Create a mapping in ASP.NET at the level of the IIS 6.0 script map
Create specific mappings in the ASP.NET HTTP handlers configuration to the static file handler (System.Web.StaticFileHandler). Create a mapping in the ASP.NET HTTP handlers configuration for each specific mapping in the IIS 6.0 scriptmaps.

For example, add a mapping in the ASP.NET HTTP handlers configuration for files that have the .htm file name extension. To do this, add the following code to the httpHandlers element in the Web.config file at the level that corresponds to where the IIS 6.0 script mapping is defined. If Aspnet_isapi.dll is mapped globally, use the Web.config file in the Config folder that is located in the .NET Framework installation folder. 

Method 2: Create a mapping in ASP.NET in the root Web.config file
Modify the root Web.config file. To do this, locate the following code in the root Web.config file.  Replace that code with the following code. 



MORE INFORMATION
Microsoft ASP.NET 2.0 delegates static file processing back to the IIS 6.0 static file handler through the Execute URL server support function. This behavior lets you to run ASP.NET authentication and authorization modules while serving static content.

Because ASP.NET 2.0 delegates static file processing back to IIS 6.0, any explicit script mapping that maps a file name extension to ASP.NET must have a corresponding mapping in ASP.NET. If the corresponding mapping in ASP.NET does not exist, ASP.NET passes the file processing back to IIS. IIS detects this recursion and then sends an empty HTTP response.

By default, default file name extensions are mapped to the DefaultHttpHandler in ASP.NET 2.0. In ASP.NET 1.1 and in ASP.NET 1.0, default file name extensions are mapped to the StaticFileHandler.

