G
Guest
Hi,
I've got the following code sample to reproduce my issue:
Public Class Form1
Inherits System.Windows.Forms.Form
Shared Sub main()
Try
Application.Run(New Form1)
Catch ex As Exception
Console.WriteLine("Test")
End Try
End Sub
[windows form designer generated code]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Throw New DivideByZeroException
End Sub
End Class
I added the sub main to insert a top level exception handler in my winforms
app.
When this is run under the debugger, this works as expected. The top level
exception handler grabs the exception and it exits gracefully. Executing
without the debugger, I get the CLR unhandled exception message about an
attempt to divide by zero. Why would the behavior differ?
-Ben
I've got the following code sample to reproduce my issue:
Public Class Form1
Inherits System.Windows.Forms.Form
Shared Sub main()
Try
Application.Run(New Form1)
Catch ex As Exception
Console.WriteLine("Test")
End Try
End Sub
[windows form designer generated code]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Throw New DivideByZeroException
End Sub
End Class
I added the sub main to insert a top level exception handler in my winforms
app.
When this is run under the debugger, this works as expected. The top level
exception handler grabs the exception and it exits gracefully. Executing
without the debugger, I get the CLR unhandled exception message about an
attempt to divide by zero. Why would the behavior differ?
-Ben