Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

Debugging under Win7/64 (VB 2008)

91 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Armin Zingler

ungelesen,
04.01.2011, 10:17:3304.01.11
an
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?

--
Armin

StrandElectric

ungelesen,
04.01.2011, 14:33:0904.01.11
an
Typical Micro$oft! Make me want to look for a stable platform elsewhere...
(er that won't then be taken over by...)

"Armin Zingler" <az.n...@freenet.de> wrote in message
news:8ogs36...@mid.uni-berlin.de...

Tom Shelton

ungelesen,
04.01.2011, 14:41:4804.01.11
an
Armin Zingler has brought this to us :

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


Cor

ungelesen,
05.01.2011, 04:11:2105.01.11
an
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:8ogs36...@mid.uni-berlin.de...

Armin Zingler

ungelesen,
10.01.2011, 16:08:5910.01.11
an
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

Armin Zingler

ungelesen,
11.01.2011, 15:26:5611.01.11
an

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-systems/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

Armin Zingler

ungelesen,
11.01.2011, 19:06:4011.01.11
an
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

Armin Zingler

ungelesen,
14.01.2011, 09:00:1914.01.11
an
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=exceptionwin7qmfq.png

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


--
Armin

Nobody

ungelesen,
14.01.2011, 14:28:4714.01.11
an
"Armin Zingler" <az.n...@freenet.de> wrote in message
news:8pb3ig...@mid.uni-berlin.de...

> 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/library/bb513641%28VS.85%29.aspx

Also, see this function:

SetErrorMode Function
http://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx

How to call:

SetErrorMode(SetErrorMode(SEM_NOGPFAULTERRORBOX) Or SEM_NOGPFAULTERRORBOX)

Armin Zingler

ungelesen,
14.01.2011, 15:20:3514.01.11
an
Am 14.01.2011 20:28, schrieb Nobody:
> "Armin Zingler" <az.n...@freenet.de> wrote in message
> news:8pb3ig...@mid.uni-berlin.de...
>> 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/library/bb513641%28VS.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

Armin Zingler

ungelesen,
19.01.2011, 10:21:5819.01.11
an
OK, I succeeded in
- the PCA has been disabled.
- The expected error dialog is back again.


What's left:
The debugger doesn't catch exceptions!

Again steps to reproduce:
1. new WindowsForms application
2. Throw exception in OnLoad
3. F5 (=start with debugger attached)

I expect the IDE to stop at the place of the exception
as it worked under WinXP! The line

<system.windows.forms jitDebugging="true" />

exists in machine.config in the 32 bit and 64 bit directory. It must work!


--
Armin

Armin Zingler

ungelesen,
19.01.2011, 10:41:3819.01.11
an
Am 19.01.2011 16:21, schrieb Armin Zingler:
> I expect the IDE to stop at the place of the exception
> as it worked under WinXP!

Instead of the debugger jumping in,
a) target = x86: The exception is ignored an the form is opened
b) target = x64: The error dialog is shown. (options=search online, debug, close)

I don't know what to do anymore.

--
Armin

Armin Zingler

ungelesen,
22.01.2011, 14:16:2022.01.11
an
Am 19.01.2011 16:41, schrieb Armin Zingler:
> I don't know what to do anymore.

I reinstalled the machine. No change. Same problems.

--
Armin

Armin Zingler

ungelesen,
27.01.2011, 10:04:5327.01.11
an

Not trying to annoy anyone.... but, I'm afraid, nothing's
getting better. Could anyone please try this? What happens?

Public Class Form1
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)

Throw New Exception

End Sub
End Class


--
Armin

Cor

ungelesen,
27.01.2011, 11:04:5527.01.11
an
Armin,

To get it running I had to made it from a kind of console application and
then to change the properties.
(Even created first a sub main which I never do, but that was not needed)

Otherwise all kind of generic created classes prevents that it even reach
it.

However, I needed to set the by my already to you told exception checkbox to
let it break.

Public Class Form1
Inherits System.Windows.Forms.Form


Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
Throw New Exception
End Sub
End Class

Success
Cor

"Armin Zingler" wrote in message news:8qdft8...@mid.uni-berlin.de...

Armin Zingler

ungelesen,
27.01.2011, 12:16:3527.01.11
an
Am 27.01.2011 17:04, schrieb Cor:
> Armin,
>
> To get it running I had to made it from a kind of console application and
> then to change the properties.
> (Even created first a sub main which I never do, but that was not needed)

I don't understand. I simply create a new WindowsForms application and paste it.

> Otherwise all kind of generic created classes prevents that it even reach
> it.
>
> However, I needed to set the by my already to you told exception checkbox to
> let it break.

I'm not sure what you mean. What happens if you start it?

> Public Class Form1
> Inherits System.Windows.Forms.Form

Isn't that in designer.vb?

Cor

ungelesen,
27.01.2011, 13:25:5727.01.11
an
Armin,

I assume I did something very stupid, I now remember me something that I
probably did wrong.

I now created a new project and pasted it.

It runs, it only throw an exception if I set that exceptions checkbox but
that is probably mine.

Success

Cor

Armin Zingler

ungelesen,
27.01.2011, 13:44:5927.01.11
an
Am 27.01.2011 19:25, schrieb Cor:
> Armin,
>
> I assume I did something very stupid, I now remember me something that I
> probably did wrong.
>
> I now created a new project and pasted it.

Cor,

thanks for trying!

> It runs, it only throw an exception if I set that exceptions checkbox but
> that is probably mine.

Yours? What happens without the exception checked? I assume it's also a 64 bit system.
I guess the Form is just shown as if no exception occured, right?


--
Armin

Cor

ungelesen,
28.01.2011, 03:42:0628.01.11
an
Yes, Yes

"Armin Zingler" wrote in message news:8qdsp9...@mid.uni-berlin.de...

Armin Zingler

ungelesen,
28.01.2011, 07:11:2928.01.11
an
Am 28.01.2011 09:42, schrieb Cor:
> Yes, Yes

:)

ok, thanks


--
Armin

0 neue Nachrichten