I'm having problems with an ASP.NET WebForms application, throwing 'System.InvalidOperationException', causing the site to crash (and restarting the application pool temporarily "solves" the issue).
In my development environment I have never seen this occur and therefore I'm having a very hard time finding the source of the problem.
How can I save some kind of dump of what a user clicked to cause this problem?
Is there a way for me to catch all exceptions, or just exceptions of InvalidOperation-type, and save them to a file, then restart the application pool programmatically? (this way I can have a "fix" while finding the cause of the error..)
Thanks in advance
EDIT
I got ELMAH working, it wasn't that hard really! I was able to catch the error and all preceeding errors. It seems the server wasn't able to serve pages fast enough, wich caused time outs, which somehow causes locks on some read/write thingy within LINQ to SQL (using SubSonic ActiveRecord) to stay locked (it sets an "_invalid"-flag to true while using the object.
The next time something tries to use the object it's already locked and the invalidoperationexception is thrown...