Using IIS & ASP.NET 2 on Windows XP

 
 

How to install Microsoft IIS5.1 on Windows XP Pro

I wanted to run a demo version of a website that I had made using ASP.NET 2. The demo was to be used for a trade show, and I wouldn't be able to get internet access to the real website. So I decided that I should install IIS6 on my PC, put my website on the PC too, and run it from there. I then discovered that Windows XP Pro doesn't support IIS6, only IIS5.1. So, here is how to put IIS5.1 onto an XP Pro machine. (People tell me that you can't put IIS5.1 on XP Home, and you can only put IIS6 on Server 2003).

Go to Control Panel, then Add or Remove Program. Select Add or Remove Windows Components. Add the IIS component. You will probably need your XP disk, or your upgrade to SP2 disk if your original XP disk is SP1.

Once IIS is installed, you can browse to http://localhost to check that it is running.

You now need to install the ASP.NET 2 framework. I already had this installed. However, ASP.NET 2 was not registered to IIS5.1, so I needed to use the DOS command aspnet_regiis to do this. This command is in the c:\Windows\Microsoft.Net\framework\v2.xxxxx folder. Use this command to install ASP.NET 2 into your IIS5.1 server.

aspnet_regiis.exe -i

You can type "aspnet_regiis.exe -lk" to check what is installed. You can also check it by going to the properties dialog of your website and looking at the Documents tab. After correct installation there will be a Default.aspx in the list of default documents.

And that is it. I found it was far easier than I thought to get a demo version of my website working on a standalone PC. You can browse to the website at http://localhost, and, if you are really sneaky, you can put a line in your HOSTS file that redirects www.mydomain.com to 127.0.0.1, thus tricking your users into thinking that they are really looking at the live site. What this does is, it allows you to browse to http://www.mydomain.com, and the HOSTS file causes this to be directed to 127.0.0.1, which is the same as localhost.