I have a problem when an unhandeld exception occurs while debugging a WinForm VB.NET project.
The problem is that my application terminates and I have to start the application again, instead of retrying the action as was the case in VS2003
The unhandeld exception is implemented in the new My.MyApplication class found in ApplicationEvents.vb
Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
Dim handler As New GlobalErrorHandler()
handler.HandleError(e.Exception)
e.ExitApplication = False
End Sub
Note: handler.HandleError just shows a dialog box and logs the error to a log file.
I also tried the following code that used to work in VS2003 but it results in the same behaviour when run in VS2008:
AddHandler System.Windows.Forms.Application.ThreadException, AddressOf OnApplicationErrorHandler
AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf OnUnhandledExceptionHandler
OnApplicationErrorHandler and OnUnhandledExceptionHandler does the same as handle.HandleError
Running the application outside VS2008 results in the expected behaviour (the application doesn't terminate) but it is increasing our test cycle during debugging.
Update: I have added sample code in my answer to demonstrate this problem in C#