SiteMapPath 在 ASP.NET 4 中停止显示
我们在页面上有一个 SiteMapPath 控件,它使用默认提供程序绑定到 XML Web.sitemap 文件。我们已经拥有这个网站很多年了,最近在 Windows 2008 R2 上的 IIS 7.5 上升级到了 ASP.NET 4.0。由于某种原因,在运行大约 6-12 小时后(不确定具体时间,但它是一致的),SiteMapPath 停止为所有人加载。如果我们重新启动应用程序池或修改并保存 web.config 或 web.sitemap XML 文件,SiteMapPath 会再次开始加载。
有谁知道可能导致此问题的原因吗?没有文件句柄使文件保持打开状态,我可以使用进程资源管理器看到该文件。
谢谢,
约翰
We have a SiteMapPath control on the page and this is bound to an XML Web.sitemap file with the default provider. We've had this site for years and have recently upgraded to ASP.NET 4.0 on IIS 7.5 on Windows 2008 R2. For some reason, after about 6-12 hours of operating (not sure exactly when, but it is consistent), the SiteMapPath stops loading for everyone. If we restart the application pool or modify and save the web.config or the web.sitemap XML files, the SiteMapPath starts loading again.
Does anyone have any ideas what could be causing this? There are no file handles keeping the file open that I can see using process explorer.
Thanks,
John
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们为此苦苦挣扎了很长一段时间,但最终还是让微软弄清楚了到底发生了什么。简而言之,微软已经通过这个修补程序解决了这个问题:
http://support.microsoft.com/default.aspx?scid =kb;en-US;2472263
在我们的例子中,如果对网站的第一个请求来自无 cookie 的设备(在我们的例子中是某个 Russion 机器人,Yandex),则将构建站点地图带有 cookieless URL 并缓存。然后,由于站点地图与无 cookie 会话的 URL 一起缓存的方式,任何支持 cookie 的设备都将永远无法工作。虽然最初的症状是随机的,但我们最终能够将其范围缩小到应用程序池回收,然后是来自该机器人的第一个请求。
如果您想强制使用 cookie,另一种可行的解决方法是对 web.config 进行此更改:
这会强制在不使用无 cookie URL 的情况下构建站点地图。
希望这有帮助!
We struggled with this for a LONG time, but were eventually able to get Microsoft to figure out what was going on. Short story is MS has addressed it with this hotfix:
http://support.microsoft.com/default.aspx?scid=kb;en-US;2472263
In our case, if the first request to the website was from a cookieless device (in our case it was some Russion bot, Yandex), the sitemap would be built with cookiless URLs and cached. Then, any devices that supported cookies would never work because of the way the sitemap was cached with URLs for cookiless sessions. While initial the symptoms were random, we eventually were able to narrow it to an app pool recycle followed by the first request from this bot.
An alternative workaround which works if you want to force cookies is to make this change to the web.config:
This forces the sitemap to be built without using cookieless URLs.
Hope this helps!!