IIS8.5自动更改物理路径属性 [英] IIS8.5 is automatically changing Physical Path property

查看:586
本文介绍了IIS8.5自动更改物理路径属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS8.5的默认网站下添加了几个应用程序(只是端口80上的http IP = *)

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

它们指向不同的物理路径(它们没有嵌套),这在添加这样的应用程序后工作正常。
但是一段时间后,其中一个应用程序的物理路径会自动更改为另一个应用程序的物理路径。为什么?
我已刷新我的DNSCache并删除并再次添加了应用程序,但有些东西正在改变我的配置的物理路径。
这可能是做什么的?有什么东西可以覆盖我的应用程序设置吗?

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?

推荐答案

我在1个解决方案中有2个站点,并且IIS中有一个站点的物理路径是随机改变到其他网站的物理路径,我不得不每次手动修复它。我终于找到了一种可靠地重现这个问题的方法。

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.

事实证明,如果SiteB的项目是独立于解决方案的其余部分重新加载的(例如,我从源代码控制中撤出)和Visual Studio提示SiteB的项目文件已更改。重新加载SiteB?),IIS中的物理路径会发生变化!通过在Visual Studio中右键单击项目并选择重新加载项目,我可以轻松地重现这一点。如果我只重新加载SiteA或SiteB,而不是重新加载完整的解决方案,IIS路径将相应地改变。

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.

因此,防止将来发生这种情况的诀窍是在提供选项时总是重新加载,如果需要,可以通过独立重新加载SiteA来翻转。

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.

我认为如果解决方案设置为使用IIS, VS将修改指定为项目加载时的默认URL的站点。或者那种效果。

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.

这篇关于IIS8.5自动更改物理路径属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆