如何防止或检测“%APPNAME%停止工作”对话框?

我正在开发一个无人照pipe的应用程序,启动另一个进程。 它最多可以有N个并行运行的进程。

当抛出未处理的exception时,将启动“%APPNAME%停止工作”对话框,并且该进程始终保持活动状态,直到有人单击“closures”button。

有没有什么方法可以防止这种情况,或者如果没有人closures对话框,就知道发生了这种情况?

我不想在系统范围内禁用它(如果有选项的话)。 就在我启动的过程

处理program.cs中的未处理的异常处理程序

AppDomain currentDomain = default(AppDomain); currentDomain = AppDomain.CurrentDomain; // Handler for unhandled exceptions. currentDomain.UnhandledException += GlobalUnhandledExceptionHandler; private static void GlobalUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e) { Exception ex = default(Exception); ex = (Exception)e.ExceptionObject; //Log and Trap exception } 

阅读更多: http : //msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx