Configure an ASP.NET Application for ASP.NET
Applies To: Windows Server 2003, Windows Server 2003 with SP1
By default, when the Microsoft® .NET Framework is installed on a computer with an existing .NET Framework installation, most Microsoft ASP.NET applications are automatically updated to use the newly installed version. The exceptions are applications that are bound to an incompatible or later version of the .NET Framework. Although later versions of the .NET Framework are designed to be backward compatible, you might need to configure an ASP.NET application to use an earlier version, if it cannot run successfully on a later version of the .NET Framework.
When multiple versions of the .NET Framework are executing side-by-side on a single computer, the ASP.NET ISAPI version script that is mapped to an ASP.NET application determines which version of the common language .NET Framework is used for the application. The following sections describe the process for configuring an ASP.NET application to target a specific version of the .NET Framework.
Requirements
Credentials: Membership in the Administrators group on the local computer.
Tools: Iis.msc.
Recommendation
As a security best practice, log on to your computer using an account that is not in the Administrators group, and then use the Run as command to run IIS Manager as an administrator. At the command prompt, type:
runas /user: administrative_accountname "mmc %systemroot%\system32\inetsrv\iis.msc".
Procedures
Viewing the Script Map for an ASP.NET Application
When managing a computer with multiple versions of the .NET Framework installed, it is often useful to view the script map for an ASP.NET application to determine which version is used by the application.
To view the script map for an ASP.NET application
Open IIS Manager, expand the local computer, and navigate to the Web site folder that contains the ASP.NET application.
Right-click the Web site folder, and then click Properties.
In the Properties dialog box, on the Home Directory tab, click the Configuration button.
In the Application Configuration dialog box, on the Mappings tab, select an ASP.NET application extension, such as .asmx or .aspx.
The Executable Path column of the dialog box lists the path to the ASP.NET ISAPI version used by the selected application type. By default, the ASP.NET ISAPI is installed in the following location: systemroot\Microsoft.NET\Framework\versionNumber
The version number shown in the path indicates the version number of the ASP.NET ISAPI used by the application type. The first two digits of the ASP.NET ISAPI version number are the same as the first two digits of the version number of the .NET Framework used by the application.
Configuring an ASP.NET Application for ASP.NET
When the .NET Framework is installed on a computer with an existing .NET Framework installation, by default all ASP.NET application script maps are automatically updated to use the newly installed version. To make it easier to reconfigure the script map for an ASP.NET application, each installation of the .NET Framework comes with an associated version of the ASP.NET IIS Registration tool (Aspnet_regiis.exe). Administrators can use Aspnet_regiis.exe to remap an ASP.NET application to the correct version of ASP.NET.
Note
Because Aspnet_regiis.exe is linked to a specific version of the .NET Framework, administrators must use the appropriate version of Aspnet_regiis.exe to reconfigure the script map for an ASP.NET application.
Aspnet_regiis.exe can also be used to display the status of all installed versions of ASP.NET, register the associated version of ASP.NET, create client-script directories, and perform other configuration operations.
To use Aspnet_regiis.exe to update a script map for an ASP.NET application
In the Run dialog box, type cmd, and then click OK.
At the command prompt, use the cd command to change the directory of the Aspnet_regiis.exe version you want to use. Remember that each version of the .NET Framework comes with its own version of Aspnet_regiis.exe. By default, Aspnet_regiis.exe is located in the following directory: systemroot\Microsoft.NET\Framework\versionNumber
You can check to see which version you are running by using the procedure "To view the script map for an ASP.NET application" earlier in this section.
Run Aspnet_regiis.exe using the -s or -sn option along with the path to the application to set up the script maps. The following command-line example updates the script maps for an application called SampleApp1.
Aspnet_regiis.exe -s W3SVC/1/ROOT/SampleApp1
Note
The -s and -sn options allow you to install script maps for ASP.NET at the specified path recursively (-s), which copies the script maps to the subfolders, or nonrecursively (-sn), which does not copy the script maps to the subfolders.
To get a list of the options available for Aspnet_regiis.exe
At the command prompt in the folder where Aspnet_regiis.exe is installed, type: Aspnet_regiis ?.
A list of options available for use with Aspnet_regiis.exe displays.