It seems when I'm in exception handler like this:
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Or like this:
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
The stack was already unwind to call my custom unhandled exception handler. Seems it doesn't make sense to write a minidump at this point cause the stack was already unwind. Without unwinding the stack application can't understand whether this exception was unhandled or not.
Even if I can see stack in UnhandledExceptionEventArgs.ExceptionObject I can't get minidump at exact place where application crashed.
Is there another way?
I know I can ask system to write a dump but I should be Administrator for that.
UPDATE:
Ok. I've got an idea ) Would be nice if in FirstChanceException handler I can walk stack back and see if this exception is unhandled or not. But this should be fast enough to work in production.
You're looking for the FirstChanceException
event, which is raised before the stack is unwound.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With