Search code examples
.netasp.netiiscsprojvs-web-application-project

Override IIS Virtual Directory/Url in Web Application Project


I have a team currently working on a Web Application project, we want to be able to run the project through our local IIS web servers and let each dev map it to whatever virtual directory they like.

Currently every time we check in we are stomping on each others virtual dir settings in th cs proj file.

I know we could just agree on a virtual directory and stick with it but that does not solve another problem I am having with this where I actually keep multiple copies of the repository on my machine and want to be able to map each to a separate virtual directory.

So the result we are looking for would look like this:

Dev1 has a checkout at say c:/dev/Webapp mapped to a virtual dir on their local IIS say localhost/WebApp

Then Dev 2 has a checkout at say c:/workspace1/WebApp mapped to a virtual dir say localhost/workspace1/MyWebApp

AND Dev 2 has a checkout at say c:/workspace2/WebApp mapped to a virtual dir say localhost/workspace2/WebApp

PS. The reason Dev 2 has two checkout is because he uses on for active dev work and the other for merging between branches.


Solution

  • Fought this war more than a few times. Our solution was to configure the projects to use the "built-in" web dev server. Then use the attach to process command to attach to the appropriate process if you need to debug the application. And there is an extension to VS2010 -- vscommands if I recall correctly -- that lets one attach to local IIS with a simple right-click on the project.

    Has some huge added advantages, such as not requiring IIS to be installed to open the project and also being friendly to folks on different versions of windows -- this trick was born when I had a dev team using XP, 2003 server and Vista at the same time and the dev team could not be forced to agree on the "right" way to do things.