8

I have a couple of Applications added under my Default Website in IIS8.5 (simply http on port 80 IP=*)

They point to different physical paths (which are not nested) and this works fine after adding such an application. But after a while the Physical Path of one of the applications automagically changes to the physical path of another Application. Why? I have flushed my DNSCache and removed and added the Application once again, but something is changing the physical path of my configuration. What could be doing this? Could something be overriding my Application settings?

Ronald
  • 417
  • 5
  • 11
  • The same thing is happening to me too! One is in a folder called 'Site' and the other is called 'Site2'. IIS keeps changing they physical path for the 'Site2' website to the same path as 'Site'. Have you figured out how to fix it? – John Rutherford Feb 27 '15 at 17:23
  • @sectrean Were either of you ever able to find what was going on here? I've been experiencing this weird problem off and on as well. – justisb Jul 17 '15 at 17:10
  • @jblasco No. I even removed one of the sites from IIS, but it will randomly remove the "2" from the end of the path. – John Rutherford Jul 23 '15 at 21:57
  • @sectrean I think I finally figured it out. Reloading one project in my shared solution caused that project's physical path to take over. See my answer posted. – justisb Jul 25 '15 at 16:04

2 Answers2

3

I have 2 sites in 1 solution, and one of the site's physical path in IIS was "randomly" changing to the other site's physical path, and I had to manually fix it each time. I finally found a way to reliably reproduce this issue.

It turned out if SiteB's project was reloaded independent of the rest of the solution (for example, I pulled from source control and Visual Studio prompted "SiteB's project file has changed. Reload SiteB?"), the physical path in IIS would change! I could easily reproduce this by right-clicking the project in Visual Studio and selecting "Reload project." If I reloaded only SiteA or SiteB, rather than reloading the full solution, the IIS path would change accordingly.

So the trick to preventing this from happening in the future was to always "Reload all" when presented with the option, and could be flipped back by reloading SiteA independently, if needed.

I think if the solution is set to use IIS, VS will modify whichever site is specified as the default URL on project load. Or something to that effect.

justisb
  • 7,081
  • 2
  • 26
  • 44
0

i ran into this as well and discovered the cause. in my case, i have a branch in git that contains a new folder path that i'm using to store a web.config to use as a reverse proxy configuration using arr. every now and then, my reverse proxy site in iis would switch folder paths to one of my other sites (that does exist in master). it finally dawned on me that when i switch from my branch to master, iis doesn't know what to do because the site is now mapped to a non-existent folder. unfortunately, it doesn't retain the now invalid path but rather switches it to a known, existing path that is equally wrong.

David Peden
  • 17,596
  • 6
  • 52
  • 72