CSharpBeginner
CSharpBeginner

Reputation: 1725

WPF event that occurs after application crash

Hello I got 2 question :

1) What event occours when the application crash? I need to invoke Dispose to resolve resources so how to do that when app crashes?

2) How to Dispose when we kill aplication procces through ALT+CTR+DELETE?

Upvotes: 1

Views: 2130

Answers (1)

Vladimir Gondarev
Vladimir Gondarev

Reputation: 1243

1) there are two event handlers:

Dispatcher.UnhandledException += Dispatcher_UnhandledException;

All unhandled exceptions in UI thread.

AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

All other exceptions ...

2) there is no way to catch the situation when your app is killed through ALT+CTR+DELETE The only Idea I can think of... create a watch dog app that checks the status of main app...

Upvotes: 4

Related Questions