4

While reading this answer, I came across the two different events

Application.Current.Dispatcher.UnhandledException

and

Application.Current.DispatcherUnhandledException

and I was wondering what the difference between those two are.


My guess is that Application.Current.DispatcherUnhandledException is kind of a wrapper for the Application.Current.Dispatcher.UnhandledException, but this is only a gut feeling and I'm very uncertain.

Does it make any difference (for single-threaded or multi-threaded applications)?

Thomas Flinkow
  • 4,845
  • 5
  • 29
  • 65
  • In the same page that you linked to there is an [explanation](https://stackoverflow.com/a/1472562/2390947) of them. – Uran Mar 22 '18 at 13:37
  • @Uran so it appears that `Application.Current.DispatcherUnhandledException` is actually merely a wrapper around `Application.Current.Dispatcher.UnhandledException` for it to be called from XAML? – Thomas Flinkow Mar 22 '18 at 13:40
  • 1
    Focus on AppDomain.CurrentDomain.UnhandledException, that is the one you care about since that is the one that tells you that your app crashed hard. – Hans Passant Mar 22 '18 at 13:44
  • 3
    I would also like to know the answer - the explanation in the linked answer does not explicitly specify if Current.Dispatcher.UnhandledException is the same thing as Current.DispatcherUnhandledException, but if it isn't then something has a very bad name! – Etherman Mar 27 '19 at 12:18
  • Does this answer your question? [Difference between UnhandledException and DispatcherUnhandledException in .NET](https://stackoverflow.com/questions/3212321/difference-between-unhandledexception-and-dispatcherunhandledexception-in-net) – Langdon Mar 02 '22 at 09:07

0 Answers0