A
Armin Zingler
Hi,
I had no problems with XP/32, but now in Win7/64, debugging works differently:
If I start from within the IDE and an exception occurs, the debugger does not break.
Instead, Win7's problem report window opens. Also the "application compatibility
assitant" (or simlar) pops up: (sorry, German text)
http://www.abload.de/image.php?img=exceptionwin7qmfq.png
If I close these and restart the application, no exception occurs. So I can't
reproduce and debug the problem.
Example:
Public Class Form1
Shared Sub main()
Try
Dim f As New Form1
Application.Run(f)
Catch ex As Exception
Stop
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
MsgBox("before")
Throw New Exception("stop now!")
MsgBox("after")
End Sub
End Class
"before" is shown, "after" is not shown, but the Form then opens normally, i.e. Form_Load
exits at the exception without any message.
If I throw the exception right at the start of Sub Main, the debugger catches it
as expected.
Tried AnyCPU and x86 target. No difference.
Tried it with vshost en-/disabled. No difference.
If i "start without debugging" (Ctrl+F5), the exception is thrown. Huh?
Do I still have to enable "jitDebugging" in machine.config? But this shouldn't
be necessary when starting from the IDE as there is already the debugger attached,
and JIT-Debugging is enabled in Options->Debugging. Whatever this "application
compatibility assistant" do to my application, I think the exception must never
be ignored! If I follow the links in the window, I'm finally lead to
http://technet.microsoft.com/default.aspx
Great, that's not very specific.
How did _you_ solve this?
I had no problems with XP/32, but now in Win7/64, debugging works differently:
If I start from within the IDE and an exception occurs, the debugger does not break.
Instead, Win7's problem report window opens. Also the "application compatibility
assitant" (or simlar) pops up: (sorry, German text)
http://www.abload.de/image.php?img=exceptionwin7qmfq.png
If I close these and restart the application, no exception occurs. So I can't
reproduce and debug the problem.
Example:
Public Class Form1
Shared Sub main()
Try
Dim f As New Form1
Application.Run(f)
Catch ex As Exception
Stop
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
MsgBox("before")
Throw New Exception("stop now!")
MsgBox("after")
End Sub
End Class
"before" is shown, "after" is not shown, but the Form then opens normally, i.e. Form_Load
exits at the exception without any message.
If I throw the exception right at the start of Sub Main, the debugger catches it
as expected.
Tried AnyCPU and x86 target. No difference.
Tried it with vshost en-/disabled. No difference.
If i "start without debugging" (Ctrl+F5), the exception is thrown. Huh?
Do I still have to enable "jitDebugging" in machine.config? But this shouldn't
be necessary when starting from the IDE as there is already the debugger attached,
and JIT-Debugging is enabled in Options->Debugging. Whatever this "application
compatibility assistant" do to my application, I think the exception must never
be ignored! If I follow the links in the window, I'm finally lead to
http://technet.microsoft.com/default.aspx
Great, that's not very specific.
How did _you_ solve this?