I am having an intermittent issue that is appearing on one server only, and is causing all MVC pages to fail to load with the error \"An item with the same key has already b
If anyone is interested, I've solved this (I think) in a very hacky kind of way... What I've done is wire up to the Application_Error
event in global.asax, and then check to see if the Server.GetLastError()
exception (or its inner exception) contains the details of the error that is thrown (see full stack trace in the question). If it does, I then call for an app domain restart using the method found in this article: http://www.west-wind.com/weblog/posts/2006/Oct/08/Recycling-an-ASPNET-Application-from-within (basically using HttpRuntime.UnloadAppDomain();
or if that doesn't work by touching the web.config file.
I need a shower...