SiteMapPath Stops Displaying in ASP.NET 4

我的未来我决定 提交于 2019-12-06 12:08:29

问题


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


回答1:


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:

<authentication mode="Forms">
     <forms cookieless="UseCookies" />
</authentication>

This forces the sitemap to be built without using cookieless URLs.

Hope this helps!!



来源:https://stackoverflow.com/questions/5900035/sitemappath-stops-displaying-in-asp-net-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!