private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) { if (Debugger.IsAttached) { // 出现未处理的异常;强行进入调试器 Debugger.Break(); } }