A nifty little command line tool

One of the most frustrating errors for me personally is during installation. Unfortunately, they happen for any number of reasons. I was working with a customer the other day that was having one of those types of issues during the installation of Visual Studio.Net. As it turns out they had installed IIS after installing the Framework on their development machine. It is important to remember that ASP.NET on IIS is not just a matter of file association. There are a variety of steps that include file associations, account creation and setting up the ISAPI extensions. Of course doing this manually is not something that is easy to do and can be frustrating. Fortunately, shipped with the Framework is a command line tool called aspnet_regiis.exe that helps to solve this problem. The file can be found under the following path:

Windows director\Microsoft NET\Framework\Framework Version

Generally the –i parameter should help to take care of the out of synch problem. However, this utility has a variety of additional switches that may be of use for other situations as shown below. MSDN has additional information about this that can be found here.

 

Option

Description

- c

Installs the client-side scripts for ASP.NET, such as client-side validation scripts, to the aspnet_client subdirectory of each IIS site directory.

Note   Only the client-side scripts for the ASP.NET version associated with Aspnet_regiis.exe are installed.

- e

Removes the client-side scripts for ASP.NET from the aspnet_client subdirectory of each IIS site directory.

Note   Only the client-side scripts for the ASP.NET version associated with Aspnet_regiis.exe are removed.

- ea

Removes the client-side scripts for all versions of ASP.NET from the Aspnet_client subdirectory of each IIS site directory.

-i

Installs the version of ASP.NET associated with Aspnet_regiis.exe and updates the script maps at the IIS metabase root and below.

Note   Only the script maps for applications that use an earlier version of the ASP.NET are updated. Applications that use a later version are not affected.

-ir

Installs the version of ASP.NET associated with Aspnet_regiis.exe and only registers ASP.NET in IIS.

Note   This option does not update the script maps. To install ASP.NET and update the script maps, use the -i option.

-k path

Removes the script maps to all versions of ASP.NET from all ASP.NET applications at the specified application root path and its subdirectories.

-kn path

Removes the script maps to all versions of ASP.NET from the ASP.NET application only at the specified application root path.

Note   This option does not affect applications in subdirectories of path.

- lk

Lists the path and version of all IIS metabase keys where ASP.NET is mapped.

Note   The keys that inherit ASP.NET script maps from a parent key are not displayed.

- lv

Lists the status and installation path of all versions of ASP.NET installed on the computer.

-r

Updates all script maps in the IIS metabase and below to point to the ASP.NET ISAPI version associated with Aspnet_regiis.exe.

Note   All existing script maps are updated to point to the ASP.NET ISAPI version associated with Aspnet_regiis.exe, regardless of the current version.

-s path

Installs the script map pointing to the ASP.NET ISAPI version associated with Aspnet_regiis.exe to all ASP.NET application at the specified application root path and its subdirectories. All existing script maps in the specified path and below that use an earlier version of the ASP.NET ISAPI are updated.

-sn path

Installs the script map pointing to the ASP.NET ISAPI version associated with Aspnet_regiis.exe to the ASP.NET application at the specified application root path. All existing script maps in the specified path that use an earlier version of the ASP.NET ISAPI are updated.

Note   This option does not affect applications in subdirectories of path.

-u

Uninstalls the version of ASP.NET associated with Aspnet_regiis.exe from the computer. Existing script maps to this version of the ASP.NET ISAPI are automatically remapped to the highest remaining ASP.NET ISAPI version installed.

-ua

Uninstalls all versions of ASP.NET from the computer.

- ?

Displays the command syntax and options for the tool.