由于某些原因,在非UI线程中发生的未处理的异常不由App_UnhandledException处理程序处理。在非UI线程中处理错误
此方法适用于Windows Phone应用程序全局处理,跟踪和分析异常,但不适用于Windows 8应用程序。
this.UnhandledException += App_UnhandledException; //doesn't handle
private void Button_Click_1(object sender, RoutedEventArgs e)
{
var task = new Task(() => { throw new NullReferenceException("Test exc in UI thread"); });
task.Start();
}
请指教。
非常感谢!这正是我需要的 –