[STAThread] static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MyForm()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }>In ASP.NET we can use the Application_Error() method of Global.asax to implement global error trapping to insure any untrapped errors still get trapped and addressed.