One of the limitations of the IIS6 on Windows XP is that IIS is limited to only one site, so I had to use virtual directories for every site I was working on. Unfortunately I had one project that has to be placed directly in the site, not in a virtual directory. That situation made some configuration issues for sites located in virtual directories due to inheritance settings from root web.config. It was nothing really serious, just small pain in the ass.
Recently I've switched to Vista and one of the first things I made was to see the new IIS7 and I've realised that with IIS7 I can set up multiple sites. That was great news indeed. Now I'm able to use separated sites for every project I have and I don't have to bother with virtual directories anymore.
First of all we have to create new site using IIS Manager. That's pretty simple and similar to IIS6. Right click on the "Web Sites" and then "Add Web Site" from the context menu.

In the "Add Web Site" dialog we have to fill all necessary fields and specify the host name we want to use.

After new site is created is ... not working, nothing happen when we will open http://mysite in browser. To fix that we have to find a file "hosts" located in C:\Windows\System32\drivers\etc\ and then edit this file in the Notepad (or whatever you are using. Only what needs to be done here is a new line as on the screen below.

Now we can browse the new site and we can set up this site in project properties using Custom Server option.

Hope that helps.
Posted
03-01-2007 2:01 PM
by
Jimmy