If you are a .net developer using Visual Studio then you probably know of the pain inflicted when taking over someone else's project and trying to get it running on your own system with full web and SourceSafe integration.
The only way to make it worse is to add multiple web sites to your machine and differentiate between them using 'host headers'. The problem is that VS.NET (or FrontPage server extensions or whatever process messes up this whole web integration) iterates through the list of available sites using WMI with complete disregard of the host headers. The last site it finds for the specified port, usually 80, is used, which is rarely the correct site.
To make a long story short, the solution of getting web integration working on the correct site is as follows:
- Temporarily put the site on a different port, e.g. 81.
- Open the solution and when VS asks you what web site to use, enter the site name AND the port number (e.g. http://localhost:81/
- With some luck - It is impossible to offer guarantees with this fragile system - VS will open the project and publish the web site to the specified URL.
- Close Visual Studio.
- Put the site back on the port you want to use, e.g. 80
- Open the '.webinfo' file from the root of the web project and change the port number from 81 to 80
- Open the solution again in VS and keep your fingers crossed an pray to whatever gods you prefer praying to.
Many thanks to Andrew Connell whose
blog post this solution is based on.