VB.NET exception doesn't stop the debugger

Hi

I'm using VB.NET Express 2008, coding a Windows Forms project, and using a WebBrowser control.

The problem is that every time I run the application and it throws an exception the debugger doesn't stop in the error line, instead, three things happen:

1- The program exits from the function or sub where the error was thrown, but all the control event handlers continue running, so if I click on a button in the form then its event code is executed.

2- The WeBrowser control navigates to an unresisting page (I see the  IE's not found error page), even if the code that threw the error is not related to the WebBrowser control.

3- In the inmmediate  Window I see the exception text, for example "A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll".

Why is this happening? When I get into an exception I expect the execution to stop immediately.

Any ideas?

Thanks.
LVL 13
rettiseertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jjardineCommented:
what line is the application throwing the error?  is it in regards to the web browser control?
0
rettiseertAuthor Commented:
Hello

Any line that throws an error (no matter which) produces the same result. Even if it is not related with the WebBrowser control.
0
rettiseertAuthor Commented:
Hi

Here you can see a demo project reproducing this error:

http://www.mediafire.com/?sharekey=5134a51d5210bb17d2db6fb9a8902bda

just run the project, click on the IE icon, and then in the Camera icon.

Thanks for any help
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

kdwoodCommented:
What is the error that you are seeing?  The only error I get is when I click on your Camera icon and that error looks like it is being raised on purpose in this line of code:

    Private Sub CaptureCurrentIEOrder()
         Err.Raise(1)
    End Sub

I get no errors or warnings when I click on the IE icon or your button.
0
rettiseertAuthor Commented:
Hi

Yes, the error is being raised on purpose as a test. What I expect after executing the line Err.Raise(1) is that the VB debugger stop and show an "Unhandling exception" window, but instead the program keeps running.
0
kdwoodCommented:
Check out this link and see if it get's you what you need.

Regards,

Keith

http://peterkellner.net/2007/08/10/stoponexceptionvs/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rettiseertAuthor Commented:
Wonderful! thank you!!!

Who changed that in my config?!
0
kdwoodCommented:
Actually, that is the default setting.  By default it seems to ignore quite a few exception errors.

Have a good weekend,

Keith
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.