Hi all,
I am having some trouble collecting information on an unhandled exception being generated (very rarely) in my code. I have set up an the handler pretty much the standard way.
In the main I have:
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionProcessor);
And the handler function is:
public void ExceptionProcessor(object sender, UnhandledExceptionEventArgs e)
{
Log(((Exception)e.ExceptionObject).StackTrace);
}
But all I ever get is a single line (not always the same one). Googling revealed that those lines are deep inside the .Net Framework libraries and are meant to be the very last line of the stack trace. So, all of the actually useful information about my code is missing. Does anyone know what could be causing this behaviour?
The line I got most recently says that it can't cast System.Threading.AutoResetEvent to System.Threading._ThreadPoolWaitOrTimerCallback.
Thanks.