Microsoft KB Archive/909642

= You receive an error message when you try to view an ASP.NET Web application on a computer that has the .NET Framework 2.0 installed =

Article ID: 909642

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft .NET Framework 2.0

-





SYMPTOMS
When you try to view a Microsoft ASP.NET Web application on a computer that has the Microsoft .NET Framework 2.0 installed, you may receive an error message that is similar to the following:

Server Error in '/Staging' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'xmlns'.

Source Error:

Line 1: 

Line 2: 

Line 3: 

Line 4: 

Source File: C:\MyProjects\MyCompany\CompanySite_deploy\Staging\web.config    Line: 2

Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

This issue may occur in the following scenarios:
 * Scenario 1
 * You create an ASP.NET Web application in Microsoft Visual Studio 2005. You do not compile the application.
 * You publish the Web application to a Web site that is hosted on Microsoft Internet Information Services (IIS).
 * Scenario 2
 * You compile an ASP.NET 2.0 Web application.
 * You create a new virtual directory in IIS to host the Web application.

In either of these scenarios, you may receive an error message when you try to view the Web page in a browser.

Note You may experience this issue even though the Web application does not use a Web.config file. If the Web application does not use a Web.config file, you may receive the following error message when the Web application calls a feature of the Microsoft .NET Framework 2.0:

Parser Error



CAUSE
This issue occurs if the application extensions for the IIS Web site are mapped to the Microsoft .NET Framework 1.1 or to the Microsoft .NET Framework 1.0. The .NET Framework 1.1 and the .NET Framework 1.0 cannot implement the configuration settings that are used by the .NET Framework 2.0.

Note When you install ASP.NET 2.0, the application extensions for a root Web site are not automatically mapped to the .NET Framework 2.0 in IIS. This behavior is intended to make sure that the existing applications that use the .NET Framework 1.1 or the .NET Framework 1.0 will continue to work as expected.



RESOLUTION
To resolve this issue, use one of the following methods.

Method 1: Configure the Web site to use ASP.NET 2.0

 * 1) Start Internet Information Services Manager.
 * 2) Expand the computer name that you want, and then expand Web Sites.
 * 3) Right-click the Web site that you want, and then click Properties.
 * 4) Click the ASP.NET tab, and then click 2.0.50727 in the ASP.NET version box.

Note If you have the .NET Framework 2.0 installed, and 2.0.50727 does not appear in the ASP.NET version box, go to the steps in the &quot;If ASP.NET 2.0 is not installed&quot; section.
 * 1) Click OK.

If ASP.NET 2.0 is not installed
If you have the .NET Framework 2.0 installed, and 2.0.50727 does not appear in the ASP.NET version box as described in step 4 in the &quot;Method 1: Configure the Web site to use ASP.NET 2.0&quot; section, follow these steps.

Note These steps will install and register ASP.NET 2.0. However, this procedure will not modify any scriptmaps.  Quit Internet Information Services Manager. Click Start, click Run, type cmd, and then click OK. At the command prompt, type the following:

Aspnet_regiis -ir

Note  is a placeholder for the folder where the .NET Framework 2.0 is installed. Follow the steps to configure the Web site to use ASP.NET 2.0.</li></ol>

Method 2: Map the application extension to the .NET Framework 2.0

 * 1) Start Internet Information Services Manager.
 * 2) Expand the computer name that you want, and then expand Web Sites.
 * 3) Right-click the Web site that you want, and then click Properties.
 * 4) Click the Home Directory tab, and then click Configuration.
 * 5) Under Application extensions, click the application extension that you want, and then click Edit.
 * 6) In the Executable box, type the path of the Aspnet_isapi.dll file in the Microsoft .NET Framework 2.0 folder on your computer.
 * 7) Click OK three times.

<div class="moreinformation_section">

MORE INFORMATION
This issue occurs because the project system does not perform version checking when you publish an ASP.NET Web application to a new Web site. When you open an existing Web site or create a new Web site in Visual Studio 2005, this issue does not occur.

When you use ASP.NET in the .NET Framework 1.1 and in the .NET Framework 1.0, you cannot compile the application at runtime. ASP.NET 2.0 in the .NET Framework 2.0 provides the functionality to compile the application at runtime.

Note When you create a new Web site or open an existing Web site that is mapped to the .NET Framework 1.1, the project system verifies the version of the .NET Framework that the Web site uses.

<div class="references_section">