.Net Error Manager

A simple project which hooks into any .net application and with as little as 1 line of code will intercept unhandled error messages and send the results to a service.

Project comprises of three distinct areas they are:

Error Client
Distributable .net dll which is used by applications to intercept unhandled errors. This has a simple Winform which will present the error information to the end users and allow details to be sent direct to the Error Server. Alternatively the integration can be managed manually by implementing the ErrorClient class.

When hooking into the ErrorClient this can be done with a single line of code (WinForms) such as:

 

            ErrorManager.ErrorClient.InitErrorClient(
                new ErrorClient.DisplayOptions(true, true),
                new ErrorClient.Options("127.0.0.1", 37773, "Admin", "passw0r!d"));

 

 

or if using ASP.Net you can hook into the Application_Error method within Global.asax file.

 

        void Application_Error(object sender, EventArgs e)
        {
            string SessionID = "unknown";

            try
            {
                SessionID = Session.SessionID;
            }
            catch (Exception err)
            {
                if (err.Message.Contains("Session state is not available in this context"))
                    SessionID = "Unable to determine Session ID";
                else
                    throw;
            }

            // Code that runs when an unhandled error occurs
            ErrorClient.InitWebErrorClient(new Options("127.0.0.1", 37773, "Admin", "passw0r!d"));

            if (!ErrorClient.GetErrorClient.SendWebError(Server.GetLastError(), SessionID, Request.Url.AbsoluteUri, Request.PhysicalPath))
            {
                //Failed to send error details to server
            }
        }

 

For both WinForm and ASP you need to add a reference to:

 

ErrorManager.ErrorClient.dll

 

and add the following to the using clause:

 

using ErrorManager.ErrorClient;

 

You will also need to distribute the following files with your application or web site:

 

ErrorManager.ErrorClient.dll

TCPMessageServer.dll

Error Server
This is a .net windows service application which manages errors from clients. 

Error Server Console
Winform application which allows developers to manage the error reports that have been submitted and configure server settings.

Error Manager Console

 

This project uses TCPMessageServer to communicate between the ErrorClient and ErrorServer.

Last edited Oct 16, 2013 at 6:20 PM by s1cart3r, version 13