Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

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.
0
rettiseert
Asked:
rettiseert
  • 4
  • 3
1 Solution
 
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now