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

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

Categories

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Disclaimer

© Justin Cooney - Programming Tips (http://jwcooney.com), 2013. You may copy/use any of the CODE found in my articles at your own risk. The code I provide is meant to be illustrative of a point and is not meant to be used in a live application. I do NOT consent to duplication of my articles. Specifically, you may not copy entire articles and publish them on your own site even if you provide a link back to my site.
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:

About these ads

1 Comment

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

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

Follow

Get every new post delivered to your Inbox.

Join 1,409 other followers

%d bloggers like this: