Exceptioneer – Error handling for Windows Forms, Services and Console Applications

Whilst we all enjoy trawling through event logs looking for exceptions that have occurred in our Windows based .NET applications it’s sometimes nicer to have those exceptions come to us. With that in mind, we’ve put together a Windows Forms Exceptioneer client which is compatible with Windows Services and Console Applications too.

These errors will appear in Exceptioneer just like ASP.NET and JavaScript errors and we’ll give you all the information you’ll need to help you debug the applications remotely. Here you can see the code and a stack trace from an Exception thrown in a Windows Forms application on the Exceptioneer site.

11-05-2009 18-57-44

Implementation is very simple, just reference the WindowsFormsClient assembly in your application and then wrap your executing code in a try {} catch {} block.

using Exceptioneer.WindowsFormsClient
        
namespace YourNamespace
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
            catch(Exception Ex)
            {
                Client WC = new Client();
                WC.ApiKey = "YOUR API KEY";
                WC.ApplicationName = "YOUR APPLICATION NAME";
                WC.CurrentException = Ex;
                WC.Submit();
            }
        }
    }
}

We’d love to hear your feedback on the Windows Forms, Windows Services and Console Application Exception Handler. Let us know what you think.

Exceptioneer – Error handling for Windows Forms, Services and Console Applications Comments