简体   繁体   English

IIS8.5自动更改物理路径属性

[英]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=*) 我在IIS8.5的默认网站下添加了几个应用程序(只是端口80 IP上的http = *)

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. 我刷新了我的DNSCache并删除并再次添加了应用程序,但有些东西正在改变我的配置的物理路径。 What could be doing this? 有什么可以这样做的? Could something be overriding my Application settings? 有什么东西可以覆盖我的应用程序设置吗?

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. 我在1个解决方案中有2个站点,并且IIS中站点的一个物理路径“随机”更改为其他站点的物理路径,我每次都必须手动修复它。 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! 事实证明,如果SiteB的项目是独立于解决方案的其余部分重新加载的(例如,我从源代码控制中提取并且Visual Studio提示“SiteB的项目文件已更改。重新加载SiteB?”),IIS中的物理路径将发生变化! I could easily reproduce this by right-clicking the project in Visual Studio and selecting "Reload project." 通过右键单击Visual Studio中的项目并选择“重新加载项目”,我可以轻松地重现这一点。 If I reloaded only SiteA or SiteB, rather than reloading the full solution, the IIS path would change accordingly. 如果我只重新加载SiteA或SiteB,而不是重新加载完整的解决方案,IIS路径将相应地更改。

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. 因此,防止这种情况在未来发生的诀窍是在提供选项时始终“重新加载所有”,并且如果需要,可以通过独立地重新加载SiteA来翻转。

I think if the solution is set to use IIS, VS will modify whichever site is specified as the default URL on project load. 我认为如果解决方案设置为使用IIS,VS将修改指定为项目加载的默认URL的任何站点。 Or something to that effect. 或者那种效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM