PC Review


Reply
Thread Tools Rate Thread

Debugging under Win7/64 (VB 2008)

 
 
Armin Zingler
Guest
Posts: n/a
 
      4th Jan 2011
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=e...onwin7qmfq.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?

--
Armin
 
Reply With Quote
 
 
 
 
StrandElectric
Guest
Posts: n/a
 
      4th Jan 2011
Typical Micro$oft! Make me want to look for a stable platform elsewhere...
(er that won't then be taken over by...)

"Armin Zingler" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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=e...onwin7qmfq.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?
>
> --
> Armin



 
Reply With Quote
 
Tom Shelton
Guest
Posts: n/a
 
      4th Jan 2011
Armin Zingler has brought this to us :
> 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=e...onwin7qmfq.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 didn't... I can't say I've ever seen this happen. I've been running
win7/64 and vs 2008/2010 on two machines and everythign seems to work
fine.

--
Tom Shelton


 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      5th Jan 2011
Armin,

I've the same VB 2010 SP1, I cannot get my hands behind it what it is, but
I'm awaiting until I see more of this before I report it.

It is so difficult to report something you don't know why and when it
occurs.

:-)

Cor

"Armin Zingler" wrote in message news:(E-Mail Removed)...

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=e...onwin7qmfq.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?

--
Armin

 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      10th Jan 2011
Am 05.01.2011 10:11, schrieb Cor:
> Armin,
>
> I've the same VB 2010 SP1, I cannot get my hands behind it what it is, but
> I'm awaiting until I see more of this before I report it.
>
> It is so difficult to report something you don't know why and when it
> occurs.
>
> :-)
>



Thanks Cor and Tom, did something else and I haven't come across this problem
lately, so I didn't answer earlier. I'll watch it if it comes back.

--
Armin
 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      11th Jan 2011
Am 10.01.2011 22:08, schrieb Armin Zingler:
> Am 05.01.2011 10:11, schrieb Cor:
>> Armin,
>>
>> I've the same VB 2010 SP1, I cannot get my hands behind it what it is, but
>> I'm awaiting until I see more of this before I report it.
>>
>> It is so difficult to report something you don't know why and when it
>> occurs.
>>
>> :-)
>>

>
>
> Thanks Cor and Tom, did something else and I haven't come across this problem
> lately, so I didn't answer earlier. I'll watch it if it comes back.


I was writing a lot about this issue yesterday, but today I prefer the
short answer. How to disable the "PCA":

http://forums.techarena.in/operating...ms/1188041.htm

The hard way, but if it works..... Well, it doesn't. :-(
The only difference I see is that the PCA window doesn't show anymore
and the application just quits without any message. If my firewall
wouldn't inform me about "WerFault.exe" (windows error report) trying
to send an error report, I would see NOTHING.

The above only applies if x64 is the target. If I target x86, it
behaves as already described: The method exits at the exception location
without a message but the application continues.


Be a debugger attached or not, it doesn't make a difference: It doesn't
stop at the exception. Though, I can catch it in code using Try-Catch.
There is not even a window asking me to send an error report or if I
want to debug.

Very strange. Investigating.....


--
Armin
 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      12th Jan 2011
Am 11.01.2011 21:26, schrieb Armin Zingler:
> Very strange. Investigating.....


One of these magic Windows-Forms things:
If the exception occurs in Button1_Click instead of Form_Load,
the IDE catches the exception. JitDebugging is enabled
in machine.config (in the 32 bit and in the 64 bit Framework
version folder).

If started without a debugger attached, I get the "Program
doesn't work anymore" window, trying to find a solution online.
Though, still no possibility to debug it. It just quits.
(no matter if x86 or x64)

I don't get it.

--
Armin
 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      14th Jan 2011
Debugging is really driving me nuts!

Whenever an exception occurs, _without_ a debugger attached,
Win7 _first_ tries to find a solution in the internet:

http://www.abload.de/image.php?img=debugging1irkj.png

How can I change Win7 so that it does _not_ look for a solution
online _first_ before asking me to debug it?

_After_ that, I'm asked to debug it or close the program:
http://www.abload.de/image.php?img=debugging25pe4.png

If I click on "close program", it is NOT closed. The window stays
there greyed-out. I have to kill it via task manager. Why?

Why is not the following dialog shown as I was always used to?
(the left window in the screenshot)
http://www.abload.de/image.php?img=e...onwin7qmfq.png

It's hard to work this way. :-(


--
Armin
 
Reply With Quote
 
Nobody
Guest
Posts: n/a
 
      14th Jan 2011
"Armin Zingler" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How can I change Win7 so that it does _not_ look for a solution
> online _first_ before asking me to debug it?


You could do it from Windows by following this article, it's for XP though:

How To Configure and Use Error Reporting in Windows XP
http://support.microsoft.com/kb/310414

Programmatically, you could tell Windows not to report the error to
Microsoft, perhaps by calling WerAddExcludedApplication(Vista+):

Windows Error Reporting:
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

Also, see this function:

SetErrorMode Function
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

How to call:

SetErrorMode(SetErrorMode(SEM_NOGPFAULTERRORBOX) Or SEM_NOGPFAULTERRORBOX)



 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      14th Jan 2011
Am 14.01.2011 20:28, schrieb Nobody:
> "Armin Zingler" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> How can I change Win7 so that it does _not_ look for a solution
>> online _first_ before asking me to debug it?

>
> You could do it from Windows by following this article, it's for XP though:
>
> How To Configure and Use Error Reporting in Windows XP
> http://support.microsoft.com/kb/310414


Yep, that's for XP. It works well under XP.

> Programmatically, you could tell Windows not to report the error to
> Microsoft, perhaps by calling WerAddExcludedApplication(Vista+):
>
> Windows Error Reporting:
> http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx


My problem is not that it reports errors. My problem is that
Win7 doesn't show the error window as I am used to (see screenshot).
I don't know why. I'll ask in a Win7 group. ... No, I've found the
setting on my own. But I've never changed it before.^^ So, this
problem is solved, finally.

Thanks.


--
Armin
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VS 2008 errors in Win7 msnews.microsoft.com Microsoft ASP .NET 4 15th Dec 2009 04:51 PM
C# WinForm VS 2003 and VS 2008 debugging problem Jason Huang Microsoft C# .NET 1 25th Sep 2009 11:45 AM
Visual Studio 2008 Debugging Options katmagic Microsoft ASP .NET 1 28th Nov 2008 03:48 PM
Debugging: expression evaluation (VC++ 2008) Armin Zingler Microsoft VC .NET 0 21st Oct 2008 09:43 PM
Problems with VS 2008 debugging Lloyd Sheen Microsoft ASP .NET 3 12th Aug 2008 07:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.