Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS8.5 is automatically changing Physical Path property

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?

like image 490
Ronald Avatar asked Dec 18 '14 10:12

Ronald


People also ask

What should be the physical path in IIS?

Physical path - This is the actual path the file is located by IIS. Virtual path - This is the logical path to access the file which is pointed to from outside of the IIS application folder. Let's display this image from Hard-drive 'E' using a virtual directory in IIS Default web site.

What is virtual path in IIS?

A virtual directory is a directory name (also referred to as path) that you specify in Internet Information Services (IIS) 7 and map to a physical directory on a local or remote server.

Why IIS virtual directory?

For example, you might use a virtual directory when you want your application to include images from another location in the file system, but you do not want to move the image files into the physical directory that is mapped to the application's root virtual directory. By default, IIS uses configuration from Web.


1 Answers

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.

like image 107
justisb Avatar answered Sep 23 '22 15:09

justisb