Despite this being one of the best error messages I've ever seen (second only to, "This operation could destabilize the rent in the space-time continuum"), it's also one of the most frustrating.
I have developed an ASP.NET MVC site which works perfectly through VS2008. It works perfectly hosted on a local IIS7 server (Win2008Server & Win7beta), and also on another Win2008Server host. A few days ago, I uploaded the site to a new host (Win2008Server), and have run into the "Operation could destabilize the runtime" error whenever one (and only one) of my LinqToSQL statements is evaluated.
The Linq statement in question has been simplified to the point of obscurity, and still whenever I evaluate the result the error occurs:
var result = from e in db.calendarEvents select e;
foreach (var event in result) // error occurs on this line
{
...
}
The remote host in question is running in full trust, and there are no switch statements in sight (these two issues came up on Google as being related to the error).
A similar issue was reported at http://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime, but there are no interfaces used (that I am aware of).
Any ideas?
--- Just a pause: The table in question uses a TIME data type, and maps to a TimeSpan property. Apparently this was only available in .NET 3.5 SP1. I'm waiting to find out if my new host has SP1 installed...