Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Debug does not stop on errors.

Debug does not stop on errors.

Scheduled Pinned Locked Moved C#
helpdebugging
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MAW30
    wrote on last edited by
    #1

    Previously when debugging my program would stop if an error occured, this no longer works. Now I have to hunt down the error which takes hours sometimes. Is there an option / setting I can change in order to stop on the error as it occurs. I appreciate any help. Thanks in advance. Michael

    S OriginalGriffO 2 Replies Last reply
    0
    • M MAW30

      Previously when debugging my program would stop if an error occured, this no longer works. Now I have to hunt down the error which takes hours sometimes. Is there an option / setting I can change in order to stop on the error as it occurs. I appreciate any help. Thanks in advance. Michael

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      Perhaps you are missing this: [Manage exceptions with the debugger - Visual Studio | Microsoft Docs](https://docs.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger?view=vs-2019)

      Quote:

      You can tell the debugger which exceptions or sets of exceptions to break on, and at which point you want the debugger to break (that is, pause in the debugger)

      Try out.

      For your read/comments: Beginner’s Guide to understand Kafka Beginners Quick Start to Learn React.js

      1 Reply Last reply
      0
      • M MAW30

        Previously when debugging my program would stop if an error occured, this no longer works. Now I have to hunt down the error which takes hours sometimes. Is there an option / setting I can change in order to stop on the error as it occurs. I appreciate any help. Thanks in advance. Michael

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        Debuggers don't "stop on errors" they stop either because they hit a breakpoint you set, or an exception occurs that you aren't handling (or that is in the "break on this exception" list your project has set). It's worth checking two things: 1) That you are actually running your app in the debugger. Yes, yes - I know that's obvious. But you'd be surprised how many people ignore the obvious ... :laugh: 2) That you haven't switched exceptions off: Go to "Debug...Windows...Exception Settings" and check that "Common Language Runtime Exceptions" is a solid black. But logic errors in your code the debugger won't automatically stop on - it has no idea what you are trying to do, so it can't! (But you knew that anyway ...)

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        Richard DeemingR 1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          Debuggers don't "stop on errors" they stop either because they hit a breakpoint you set, or an exception occurs that you aren't handling (or that is in the "break on this exception" list your project has set). It's worth checking two things: 1) That you are actually running your app in the debugger. Yes, yes - I know that's obvious. But you'd be surprised how many people ignore the obvious ... :laugh: 2) That you haven't switched exceptions off: Go to "Debug...Windows...Exception Settings" and check that "Common Language Runtime Exceptions" is a solid black. But logic errors in your code the debugger won't automatically stop on - it has no idea what you are trying to do, so it can't! (But you knew that anyway ...)

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          OriginalGriff wrote:

          an exception occurs that you aren't handling (and that is in the "break on this exception" list your project has set)

          The "break on this exception" setting overrides the unhandled part. You use it to break on exceptions which are handled in code. The debugger will always break on unhandled exceptions. Manage exceptions with the debugger - Visual Studio | Microsoft Docs[^]


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          OriginalGriffO 1 Reply Last reply
          0
          • Richard DeemingR Richard Deeming

            OriginalGriff wrote:

            an exception occurs that you aren't handling (and that is in the "break on this exception" list your project has set)

            The "break on this exception" setting overrides the unhandled part. You use it to break on exceptions which are handled in code. The debugger will always break on unhandled exceptions. Manage exceptions with the debugger - Visual Studio | Microsoft Docs[^]


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #5

            Monday morning mode ... :doh:

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups