Ignacio,
Actually I already have an event handler set up like that. The message is JIT Debugging Failed with the following error: 0x800405a6.
Documentation says:
JIT Debugging failed with the following error: 0x800405a6This error occurs if you attempt to do Just-In-Time debugging on a machine where there is no user logged onto the console. As a result, there is no session in which to display the Just-In-Time debugging dialog box.
To fix this problem, log onto the machine.
I am running this application under the scheduler so I am unsure why I get this with this application but yet none of my other .Net applications get this.
In main() I have:
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new EventHandler(LastChanceHandler);
Then the method:
void LastChanceHandler(object sender, UnhandledExceptionEventArgs args)
{
Exception ex = ((Exception)(args.ExceptionObject));
Logging.WriteLine("****** LastChanceHandler ******");
Logging.WriteLine("ExceptionType: {0}", ex.GetType().Name);
Logging.WriteLine("HelpLine: {0}", ex.HelpLink);
Logging.WriteLine("Message: {0}", ex.Message);
Logging.WriteLine("Source: {0}", ex.Source);
Logging.WriteLine("StackTrace: {0}", ex.StackTrace);
Logging.WriteLine("TargetSite: {0}", ex.TargetSite);
string indent = "" + Microsoft.VisualBasic.Chr(9) + "";
Exception ie = ex;
while (!((ie.InnerException == null))) {
ie = ie.InnerException;
Logging.WriteLine(indent + "****** Inner Exception ******");
Logging.WriteLine(indent + "ExceptionType: {0}", ie.GetType().Name);
Logging.WriteLine(indent + "HelpLine: {0}", ie.HelpLink);
Logging.WriteLine(indent + "Message: {0}", ie.Message);
Logging.WriteLine(indent + "Source: {0}", ie.Source);
Logging.WriteLine(indent + "StackTrace: {0}", ie.StackTrace);
Logging.WriteLine(indent + "TargetSite: {0}", ie.TargetSite);
indent += "" + Microsoft.VisualBasic.Chr(9) + "";
}
}
Any ideas on how to capture what is wrong???
Thanks,
Matt