Justin Cooney

Web Development Tips and Examples

Register ASP.NET with IIS
Register ASP.NET with IIS

I was setting up a new Web Server that had been pre-installed with Windows 2003IIS 6 and ASP.NET 2.0. The catch was that when I set up a new Web site on the server, I would get a 404 error page when the server was asked to serve up ASP.NET files (aka: files with the .aspx extension). Other files such as standard .html and .asp would render without problems.

I was a bit mystified until I realized that the setup of the pre-installed version of ASP.NET 2.0 on the server likely was done before IIS setup. Thus, although IIS showed ASP.NET 2.0 as an option, ASP.NET wasn’t properly registered with IIS.

At that point all one can do is to either:

  1. Uninstall & re-install ASP.NET
  2. Register ASP.NET with IIS using the command line tool aspnet_regiis.exe

I chose to go the command line registration route using the aspnet_regiis.exe tool. As expected this solved the 404 error issue and I was able to finish setting up my sites on the new server.

Using the Aspnet_Regiis.exe Tool

For example, to register ASP.NET 2.0:

  1. Click the start menu and type cmd in the editable text area.
  2. You should see a DOS command prompt.
  3. Navigate in your DOS  command prompt to your ASP.NET framework folder. In my case this was located at:
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
  4. At this point you can call the command line tool to register ASP.NET with IIS using the syntax:
    aspnet_regiis.exe -i -enable

You will, of course, need to repeat these steps for any other versions of ASP.NET that have not been properly registered on your server.

Here are some related articles that I have written on the topic:

Posted in , , , , , , , , , , ,

2 responses to “Correcting 404 Errors in IIS 6 When Running an ASP.NET ASPX Page”

  1. […] How to correct 404 errors for ASP.NET pages on a new Web server.  […]

Leave a reply to Yes, Installing .NET 4 on IIS 6 Windows Server 2003 Will Require a Server Restart « Justin Cooney Cancel reply