public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(UnhandledExceptionEventHandler);
}
private void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e)
{
throw new NotImplementedException();
}
}
在文件的启动类中添加如上代码;在UnhandledExceptionEventHandler方法中进行异常的处理