Re: crash in release build
- From: "John Duval" <JohnMDuval@xxxxxxxxx>
- Date: 7 Feb 2007 04:43:47 -0800
Hi,
If you don't have any idea where it's crashing (like the call stack),
you might want to consider implementing a centralized unhandled
exception handler.
// Add the event handler for handling UI thread exceptions to the
event.
System.Windows.Forms.Application.ThreadException += new
ThreadExceptionEventHandler(Application_ThreadException);
// Set the unhandled exception mode to force all Windows Forms errors
to go through our handler.
System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
// Add the event handler for handling non-UI thread exceptions to the
event.
AppDomain.CurrentDomain.UnhandledException += new
UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Then in the exception handlers, you can get the stack, for example:
private static void Application_ThreadException(object sender,
ThreadExceptionEventArgs e)
{
// e.Exception.StackTrace will contain the call stack where
the exception occurred, write it to a file or something....
...
}
If that's not helping very much, you could try to use a tool like
ADPlus to grab a crash dump of the process and use Windbg with the SOS
extension to look at the state of the program at the time of the
crash. That's more work though.
Hope that helps,
John
On Feb 7, 7:19 am, bjor...@xxxxxxxxx wrote:
The application i build in C#.net is crashing once a month. I can't
reproduce the crash.
Is there a way to track down where the program crashes, without
putting logging everywhere in the code? Is there a way to get a stack
trace of the crashing program (by the way, i'm new to C#.net, i have
experience in (unmanaged) C++).
Thanks in advance.
.
- References:
- crash in release build
- From: bjornms
- crash in release build
- Prev by Date: Re: crash in release build
- Next by Date: Re: crash in release build
- Previous by thread: Re: crash in release build
- Next by thread: Re: crash in release build
- Index(es):
Relevant Pages
|
Loading