Pages

Monday, January 30, 2012

Aspnet_Regiis Utility

Aspnet_Regiis Utility
It is the IIS registration tool that is used to register the ASP.Net with IIS. It will update the script map of an application to the coresponding ISAPI extensions to process the request given to the IIS. For example, “aspx” extension will be mapped to aspnet_isapi.dll and hence request for an aspx page to IIS will be given to aspnet_isapi. Refer the below figure for a sample script map.
You can bring the script map by right clicking Root directory or a website >  property > Click Configuration from “Home Directory” tab.

 This is the tool that is used to configure different versions of asp.net to run side by side in the same web server.
One thing to note here is, each version of framework will have its own Aspnet_Regiis utility packed in it i.e. if there is 1.1 and 2.0 framework installed on the box then each version will have its own Aspnet_Regiis utility.

For example, 1.1 framework utility will be in,

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322

For example, 2.0 framework utility will be in,

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>








A Common Solution with Aspnet_Regiis utility
Executing this utility with –i switch will be a common solution for number of issues we face. One such example will be the following error,
The XML Page cannot be displayed.
Cannot view XML input using XSL style sheet.

Refer the below figure.

The above command will update the script map of the root directory of the web server and hence making all the website’s script map under the root updated with the current version. Since we have more than one version of ASP.Net (1.1,2.0 etc) there are possibilities that the web server may have websites running on different version of asp.net. The above command will update the script map of all the websites and thus making the other websites settings running in different version disturbed.

Configuring ASP.Net Side by Side Execution Using Aspnet_Regiis Utility
To achieve this we need to update the script map specific to the application/website instead of root level. It can be done by using “-s” switch.

Aspnet_regiis –s path

Example
Aspnet_regiis –s W3SVC/1/ROOT/CodeDigest

Where CodeDigest is the application or virtual directory whose script map has to be updated. Thus, the other websites configurations are intact.

So to register 1.1 framework,

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>Aspnet_regiis -s W3SVC/1/ROOT/CodeDigest

For 2.0 framework,

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>Aspnet_regiis -s W3SVC/1/ROOT/CodeDigest

No comments: