Unreported Unhandled Exception

E

eBob.com

Nevermind why, but I recently ran the following simple program, in the
Debugger.

Option Strict On
Option Explicit On

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim somearray() As Integer
'Try
somearray(4) = 4
somearray(7) = 7
For Each Int As Integer In somearray
MsgBox("int is " & Int)
Next
'Catch ex As Exception
' MsgBox(ex.ToString)
'End Try
End Sub
End Class

Without the Try/Catch (note that it is commented out), I never saw the
MsgBoxes, never saw anything about an exception, but did see my (completely
blank, as it should have been) Form1.

It's been my experience, and my research indicates, that unhandled
exceptions are always reported. There IS an exception because the Try/Catch
does catch it.

If I put a breakpoint on the Load handler Sub and step through statement by
statement, when I step to the next statement following the somearray(4)=4
the Debugger quits and I see my Form1.

Is this a bug?

I'm using VBE 2008 with .NET 3.5 SP1 on Vista x64.

Thanks, Bob
 
A

Armin Zingler

eBob.com said:
If I put a breakpoint on the Load handler Sub and step through
statement by statement, when I step to the next statement following
the somearray(4)=4 the Debugger quits and I see my Form1.

Is this a bug?

I'm using VBE 2008 with .NET 3.5 SP1 on Vista x64.

Almost the same here but WinXP 32, but that shouldn't matter. I can't repro
the problem. I get a NullReferenceException, no
matter which setting I choose under menu Debugger -> Exceptions. This
doesn't help you; just wanted to let you know. Currently I have no idea
about the cause of this behavior.


Armin
 
E

eBob.com

Armin Zingler said:
Almost the same here but WinXP 32, but that shouldn't matter. I can't
repro
the problem. I get a NullReferenceException, no
matter which setting I choose under menu Debugger -> Exceptions. This
doesn't help you; just wanted to let you know. Currently I have no idea
about the cause of this behavior.


Armin
Thanks for looking at this Armin. I will report it.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top