I have 2 sites in 1 solution, and one of the physical paths of the site in IIS was "randomly" changed to the physical path of another site, and I had to manually fix it every time. Finally, I found a way to reliably reproduce this problem.
It turned out that if the SiteB project was reloaded regardless of the rest of the solution (for example, I pulled it out of the source control and Visual Studio asked "the SiteB project file has changed. Reload SiteB?"), The physical path in IIS changed! I could easily reproduce this by right-clicking on a project in Visual Studio and selecting "Update Project". If I reloaded only SiteA or SiteB, and did not reload the full solution, the IIS path would change accordingly.
So the trick that prevented this from happening in the future was to always โreset everythingโ when it was presented with the option, and can be discarded by reloading SiteA independently if necessary.
I think that if the solution is configured to use IIS, VS will change whichever site is listed as the default URL for loading the project. Or something like that.
source share