Just had a situation where there was a need for a global error handler method for windows applications in .NET. This handler should be invoked whenever there is an unhandled error raised in the windows application.
A way to do this is handling the ThreadException event of the Application object.
/// The main entry point for the application.
static void Main()
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
Maybe there are other methods of doing this as well. But for a single threaded application this seemed ok.