Global Error Handler
-
I'm looking for a solution to handle all unhandled errors within a VB.NET application. I would like it to log information such as, error number, line number, call stack, variables and values, etc.. Basically as much information as possible. If someone knows where I can get information on the best way to do this, has some sample code or knows of an available product (commercial or freeware) I would appreciate knowing about it. Thanks
-
I'm looking for a solution to handle all unhandled errors within a VB.NET application. I would like it to log information such as, error number, line number, call stack, variables and values, etc.. Basically as much information as possible. If someone knows where I can get information on the best way to do this, has some sample code or knows of an available product (commercial or freeware) I would appreciate knowing about it. Thanks
Microsoft create some stuff called the "Application Blocks for .NET" a while back. One of those was called "Exception Management". They're complex, but they're free. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
Microsoft create some stuff called the "Application Blocks for .NET" a while back. One of those was called "Exception Management". They're complex, but they're free. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
I have a simple class which does all this for you. When your program initialises, you do this:
If (Not System.Diagnostics.Debugger.IsAttached) Then ExceptionManager.Instance().AppName = "YourAppNameHere" End If
The class then pops up a dialog when an exception occurs, showing the stack-trace, error message, etc, and on closing that dialog, a new instance of the program can optionally be started. You don't have to have theDebugger.IsAttached
test, but it means that the exception handler won't pop up if you are debugging in the IDE. Let me know if it sounds like what you need. -
I have a simple class which does all this for you. When your program initialises, you do this:
If (Not System.Diagnostics.Debugger.IsAttached) Then ExceptionManager.Instance().AppName = "YourAppNameHere" End If
The class then pops up a dialog when an exception occurs, showing the stack-trace, error message, etc, and on closing that dialog, a new instance of the program can optionally be started. You don't have to have theDebugger.IsAttached
test, but it means that the exception handler won't pop up if you are debugging in the IDE. Let me know if it sounds like what you need.Sounds simple enough. Perhaps you might direct this to the attention of the person who posted the original query; by replying to my reply, the message went to me instead of him. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
I have a simple class which does all this for you. When your program initialises, you do this:
If (Not System.Diagnostics.Debugger.IsAttached) Then ExceptionManager.Instance().AppName = "YourAppNameHere" End If
The class then pops up a dialog when an exception occurs, showing the stack-trace, error message, etc, and on closing that dialog, a new instance of the program can optionally be started. You don't have to have theDebugger.IsAttached
test, but it means that the exception handler won't pop up if you are debugging in the IDE. Let me know if it sounds like what you need.