I have my website hosted on a IIS locally. My project has different branches in TFS, and whenever I open a project in Visual Studio, it automagically changes the IIS website physical path to the project being opened. Is it possible to prevent Visual Studio from automatically changing the physical path in IIS? (I only wish to change it manually from the IIS GUI).
Asked
Active
Viewed 625 times
2
-
[possibly relevant](https://programmers.stackexchange.com/questions/73856/tfs-web-sites-based-under-iis-how-to-handle-branching) – user5226582 Sep 29 '16 at 07:23
-
There are many posts with this question, but all answers I have seen just present work-arounds, which may not always be appropriate or even possible. Does anyone know how to simply prevent Visual Studio from making these changes (unannounced)? – David I. McIntosh Oct 16 '17 at 12:18
-
The answer to this post (https://stackoverflow.com/questions/27544123/iis8-5-is-automatically-changing-physical-path-property) for example, simply states how to ensure that visual studio repoints competing profiles in the correct order, so that the last repoint it does is (perhaps) the one you want. But this is quite useless if you simply do not want your server pointing to the middle of your source tree at all. – David I. McIntosh Oct 16 '17 at 12:57
-
The answer in this post is simply wrong (https://stackoverflow.com/questions/21046198/opening-projects-changes-iis-settings). This post (https://stackoverflow.com/questions/15646726/visual-studio-2012-changes-iis-application-directory-without-asking) has no answer. This post (https://stackoverflow.com/questions/3093433/visual-studio-creating-iis-virtual-directories-when-solution-opened) simply confirms the behaviour. – David I. McIntosh Oct 16 '17 at 13:54
-
This behavior cannot be changed, as if VS does not change that path, then when you open a specific web project in VS, you cannot debug it properly, because that web project itself would require IIS to point to a specific path. Thus, either you get used to it, or you configure all web projects not to use IIS at all (use IIS Express for example). – Lex Li Oct 16 '17 at 14:18
-
Not true that you cannot debug it properly. If you manage the physical path of the virtual directory through the inetmgr app (actually, it just needs to be set once to the directory one up from the output "bin" directory, which just may not be in the middle of your project), you can debug just fine, and in fact as soon as Visual Studio resets the physical path (to the project directory), you can no longer run the web app and no longer debug. In other words, your statement is only true for setups that mimic the prescribed Visual Studio setup, which I personally think is a very poor setup. – David I. McIntosh Oct 16 '17 at 16:06