namespace Desktop { internal static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application.ThreadException += (s, e) => MessageBox.Show($"UI Thread Crash: {e.Exception.Message}\n\n{e.Exception.StackTrace}", "Fatal Error"); AppDomain.CurrentDomain.UnhandledException += (s, e) => MessageBox.Show($"Background Crash: {((Exception)e.ExceptionObject).Message}\n\n{((Exception)e.ExceptionObject).StackTrace}", "Fatal Error"); ApplicationConfiguration.Initialize(); Application.Run(new Form1()); } } }