SiteMapPath Stops Displaying in ASP.NET 4
Asked Answered
D

1

2

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

Domel answered 5/5, 2011 at 15:9 Comment(0)
I
2

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!!

Issykkul answered 31/8, 2011 at 14:41 Comment(1)
Wow, that is a really bad bug! Makes me question forms authentication on many levels. We changed to UseCookies for the cookieless mode and have not had any further problems.Domel

© 2022 - 2024 — McMap. All rights reserved.