static void Main(string[] args) { // Disable the WinForms unhandled exception dialog. // SurfaceShell will notify the user. Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException); //Application.Run(new Form1()); Form1 form = new Form1(); form.startCOVER(args); form.Show(); // the loop is here to keep app running if non-fatal exception is caught. do { Application.DoEvents(); form.Frame(); } while (!form.IsDisposed); }