My program dont stop when an error occurs

Sometimes in my program, when i run it in visual studio and there is an error, it dont stop and show the debug window. Instead it just exits the sub where the error is and continues.

Is this some function i can set to on/ off



Answer this question

My program dont stop when an error occurs

  • George2

    That one already is checked.. This is really strange


  • StephanieR

    They are all checked, so it cant be that
  • Sweeps78

    You can go to (menu) Debug>Exceptions>Common Language Runtime Exceptions and check the Thrown checkbox. That should help you.



  • xaitech

    Yearh, but that only help my in that specific stuation. The problem is that it is when im coding and debugging that i want the program to stop so that i easily can find any error in my application before i release it. The best way to correct errors is when the program stops and give me a line number and error code..
  • Hans1982

    What exactly do you mean by "error" and how do you know that one is occurring   Can you show an example in your code of where this happens

  • ariefcrawfordconnect

    How about ..Tools...Options...Debugging.."break All Processes when one breaks" and from

    MyProject..Debug..."Enable Visual Studio hosting process"



  • Sledgehammer

    The reason i now is that, in my program it was suppodes to do one thing in an opened up form, but instead it just closed the window. I then inserted a break to manually go through the code one line at a time, and i then found the error in an sql command.

    But the thing that stroke me with this, was that when it got to the cmd.executenonquery command, it exited the sub (and when the sub was exited the window would close as it should). Normally when i make an error in an sql command the program stops and give me the error and line number in wich the error occurred. Here it just skips all that and exits the sub and the program continues.


  • Keith Smith

    Have you tried putting a try catch around the offending lines of code..

  • My program dont stop when an error occurs