开发者

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 ea开发者_如何学Goch 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.


In the properties for the Web Application Project, where you indicate whether to use the Local IIS server, you can specify that the setting in the Servers section not be stored in the Project file and thus apply to all users. Do that once, and it should then be the case that any developer can change those settings without triggering a change to the project file and thus prevent developers from stomping upon one another.

Override IIS Virtual Directory/Url in Web Application Project


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.


Not so clear on the question. Each team member can run the project in their own local IIS in which case it doesn't conflict with others. I guess you need some kind of source control like VSS of TFS to make the changes to the file more synchronized.


If your team members are all using Windows Vista or 7, their local IIS must be the version 7 or 7.5. The good thing of IIS 7.x is that we can run multiple web sites at the same time, while IIS 5.1 on Windows XP can only run one web site at once.

Therefore, your team can setup each web application project using a single web site in their local IIS, rather than a virtual directory under the "Default Web Site" which is represented as "localhost". Of course, in order for them to do so, they need to modify the "hosts" file at C:\Windows\System32\drivers\etc.

For example, If your team runs more than one web application projects like admin and public, they can have "admin.local" and "public.local" as their domain name respectively. Of course these domain names must be stored in all team members' "hosts" file.

So, their URL will be:

  • localhost/admin -> admin.local
  • localhost/public -> public.local

If members in a certain project all agree to use this, they won’t need to get bothered with the virtual directory issue that keeps changing whenever you download files from your version controller, I believe. Hope this can give you an insight.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜