.Net, ASP.NET, C#, Classic ASP, HTML, IIS, IIS6, Programming, Software, VB.NET, Web Development, Web Server

Correcting 404 Errors in IIS 6 When Running an ASP.NET ASPX Page

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:
  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:

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s