Skip to content

Instantly share code, notes, and snippets.

@hagbarddenstore
Created August 16, 2013 11:14
Show Gist options
  • Save hagbarddenstore/6249057 to your computer and use it in GitHub Desktop.
Save hagbarddenstore/6249057 to your computer and use it in GitHub Desktop.
namespace ConsoleApplication7
{
using System;
public class Program
{
public static void Main()
{
AppDomain.CurrentDomain.UnhandledException += HandleUnhandledException;
throw new Exception();
}
private static void HandleUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Console.WriteLine("Press Enter to exit...");
Console.ReadLine();
Environment.Exit(1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment