I have a Windows Form application that has a global error handler to display unexpected errors.
Namespace My
Class MyApplication
Delegate Sub ProcessParametersDelegate(ByVal sender As Object, ByVal args() As String)
Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
Dim ErrorText As String = e.Exception.Message & ", " & e.Exception.StackTrace
Try
MessageBox.Show("Global Error Handler: An unhandled error occurred. It will be copied to your clipboard upon OKing this message: " & ErrorText)
Clipboard.SetText(ErrorText)
Catch ex As Exception
End Try
End Sub
End Class
End Namespace
In VS2008, I have my Debug - > Exceptions options set to the defaults, which are to raise an error on all unhandled exceptions.
I have a few issues:
1) for the same deployed code, I SOMETIMES get line number in the displayed StackTrace error message and sometimes do not, even when the error message includes source code that I have written rather than a referenced binary. The project is compiled with a DEBUG configuration.
2) The application strangely minimizes to the tray when the error occurs (I thin it is unlikely that anyone can diagnose this issue w/o my more code posted, but I'll mention it anyways)
3) When I try to intentionally raise an error by, for example, dividing by zero hoping to test by global error handler, I get a dialog error message from the interactive debugger rather than jumping into my global error handler (which i want to debug because there is more to it than I posted.) Do you have any idea how to triggerand force teh execution of the global event handler?