【发布时间】:2018-11-26 19:17:37
【问题描述】:
继承的 WPF 应用程序在 App.xaml.cs 中设置 Dispatcher.UnhandledException:
public App() : base()
{
this.Dispatcher.UnhandledException += OnDispatcherUnhandledException;
}
除了我偶尔会在没有调用 OnDispatcherUnhandledException 的情况下得到“程序已停止工作”。 根据其他线程中的大量讨论,我添加以下内容:
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
但不明白这有什么帮助。 谁能解释一下 Dispatcher 和 CurrentDomain UnhandledException 的区别?
【问题讨论】:
标签: c# wpf unhandled-exception