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. Visual Studio Debugger Questions

Visual Studio Debugger Questions

Scheduled Pinned Locked Moved C#
csharpvisual-studiodebuggingtutorialquestion
7 Posts 5 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.
  • Z Offline
    Z Offline
    zequion
    wrote on last edited by
    #1

    1.- When I use the Visual Studio debugger, if the form is large I can not see the code below. How to hide the form? 2.- I have read that I can stop the execution in the debugger (F9) and that I can press Interrupt, Modify a line and Continue. But he will not let me interrupt. How is made? Because now I have to stop the execution and start again. Thanks

    S J 2 Replies Last reply
    0
    • Z zequion

      1.- When I use the Visual Studio debugger, if the form is large I can not see the code below. How to hide the form? 2.- I have read that I can stop the execution in the debugger (F9) and that I can press Interrupt, Modify a line and Continue. But he will not let me interrupt. How is made? Because now I have to stop the execution and start again. Thanks

      S Offline
      S Offline
      Slacker007
      wrote on last edited by
      #2

      If you have two monitors, which you should, then drag the form into one monitor and observe the debugging in the other monitor(the one with the VS IDE running). This works for most forms and website debugging. I have never needed to interrupt a debugging session....ever. Not to say that someone out there doesn't need to do this. I just isolate the code that needs to be debugged, and set breakpoints there, or start from the beginning of the code path, if I need to broaden my scope. What I do is set a breakpoint close to where the action that I want to observe is going to take place and then run the application. use F10 to advance line by line, and F11 to step into methods. If you need to observe a collection or object variable then just right click on the variable and select Quick Watch... Go to Youtube and search for .net VS debugging tips and how to videos, if you think that would help you learn more about this. Edit: You can also use "Run to cursor" if you want to skip sections of code and not have to debug the code line by line. Just place your cursor somewhere further in the code path, and then right click and select run to cursor. I use this a lot to jump over loops or to skip larger areas of code that I don't need to see. You can also drag the yellow arrow on the left side of the code viewer to a desired code path that has already executed, and repeat "most" code execution again, if needed. This is not good for all scenarios because variables and values can change during the first pass of the code execution. I use this sometimes when debugging Unit Tests, and I want to run the test again without stepping out of the debugger instance. Also, look into conditional expressions when debugging as well - where applicable.

      Z 1 Reply Last reply
      0
      • S Slacker007

        If you have two monitors, which you should, then drag the form into one monitor and observe the debugging in the other monitor(the one with the VS IDE running). This works for most forms and website debugging. I have never needed to interrupt a debugging session....ever. Not to say that someone out there doesn't need to do this. I just isolate the code that needs to be debugged, and set breakpoints there, or start from the beginning of the code path, if I need to broaden my scope. What I do is set a breakpoint close to where the action that I want to observe is going to take place and then run the application. use F10 to advance line by line, and F11 to step into methods. If you need to observe a collection or object variable then just right click on the variable and select Quick Watch... Go to Youtube and search for .net VS debugging tips and how to videos, if you think that would help you learn more about this. Edit: You can also use "Run to cursor" if you want to skip sections of code and not have to debug the code line by line. Just place your cursor somewhere further in the code path, and then right click and select run to cursor. I use this a lot to jump over loops or to skip larger areas of code that I don't need to see. You can also drag the yellow arrow on the left side of the code viewer to a desired code path that has already executed, and repeat "most" code execution again, if needed. This is not good for all scenarios because variables and values can change during the first pass of the code execution. I use this sometimes when debugging Unit Tests, and I want to run the test again without stepping out of the debugger instance. Also, look into conditional expressions when debugging as well - where applicable.

        Z Offline
        Z Offline
        zequion
        wrote on last edited by
        #3

        905/5000 But what I have asked is that I have read that you can press F9 and for debugging. Then "Interrupt" is pressed, the line of code is modified and "Continue" is pressed. However "Interrupt" is disabled. That's why I have to stop and restart every time and so for years. On the other hand, to see the hidden code below the form, do I need two monitors? Then it does not serve me because it is not practical and it would be easier an option, which does not exist, to hide the form. I stay as I was uninformed. Thanks for your effort, does anyone have more information? I am finding many bugs to Microsoft with so many years, so many resources and so many smart people. A little comment. In the latest version of "Visual Studio" the only difference is that it is called 2015, the rest is the same. And if you read my blog about Windows 10 you'd be surprised at the number of glitches, apart from being a spyware program in its entirety. Congratulations to all of you. I have taken note of a great sentence that I have been given: "It is a question of being in the right place and at the right time to do what is right."

        D L 2 Replies Last reply
        0
        • Z zequion

          1.- When I use the Visual Studio debugger, if the form is large I can not see the code below. How to hide the form? 2.- I have read that I can stop the execution in the debugger (F9) and that I can press Interrupt, Modify a line and Continue. But he will not let me interrupt. How is made? Because now I have to stop the execution and start again. Thanks

          J Offline
          J Offline
          Jon McKee
          wrote on last edited by
          #4

          1. As Slacker007 said, use another monitor. If that isn't available, try re-sizing if available. 2. I believe what you're looking for is [Edit and Continue](https://msdn.microsoft.com/en-us/library/ms164926.aspx). You need to enable it in Tools > Options > Debugging > Edit and Continue. More information can be found [here](https://msdn.microsoft.com/en-us/library/bcew296c.aspx). Best of luck!

          1 Reply Last reply
          0
          • Z zequion

            905/5000 But what I have asked is that I have read that you can press F9 and for debugging. Then "Interrupt" is pressed, the line of code is modified and "Continue" is pressed. However "Interrupt" is disabled. That's why I have to stop and restart every time and so for years. On the other hand, to see the hidden code below the form, do I need two monitors? Then it does not serve me because it is not practical and it would be easier an option, which does not exist, to hide the form. I stay as I was uninformed. Thanks for your effort, does anyone have more information? I am finding many bugs to Microsoft with so many years, so many resources and so many smart people. A little comment. In the latest version of "Visual Studio" the only difference is that it is called 2015, the rest is the same. And if you read my blog about Windows 10 you'd be surprised at the number of glitches, apart from being a spyware program in its entirety. Congratulations to all of you. I have taken note of a great sentence that I have been given: "It is a question of being in the right place and at the right time to do what is right."

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            It's not really clear if you know this, but F9 doesn't stop the code from running. It sets a breakpoint on the line the cursor is on in the code editor. When execution gets to that line the code stops running at that point. That's when you can inspect variable contents, stack trace, and see what's going on.

            A guide to posting questions on CodeProject

            Click this: Asking questions is a skill. Seriously, do it.
            Dave Kreskowiak

            Z 1 Reply Last reply
            0
            • D Dave Kreskowiak

              It's not really clear if you know this, but F9 doesn't stop the code from running. It sets a breakpoint on the line the cursor is on in the code editor. When execution gets to that line the code stops running at that point. That's when you can inspect variable contents, stack trace, and see what's going on.

              A guide to posting questions on CodeProject

              Click this: Asking questions is a skill. Seriously, do it.
              Dave Kreskowiak

              Z Offline
              Z Offline
              zequion
              wrote on last edited by
              #6

              I checked what they told me about the configuration in "Tools", everything is correct but "Interrupt" is disabled and I can not edit and continue. As long as I have a while I will look at the link that passed me this fellow. Thank you

              1 Reply Last reply
              0
              • Z zequion

                905/5000 But what I have asked is that I have read that you can press F9 and for debugging. Then "Interrupt" is pressed, the line of code is modified and "Continue" is pressed. However "Interrupt" is disabled. That's why I have to stop and restart every time and so for years. On the other hand, to see the hidden code below the form, do I need two monitors? Then it does not serve me because it is not practical and it would be easier an option, which does not exist, to hide the form. I stay as I was uninformed. Thanks for your effort, does anyone have more information? I am finding many bugs to Microsoft with so many years, so many resources and so many smart people. A little comment. In the latest version of "Visual Studio" the only difference is that it is called 2015, the rest is the same. And if you read my blog about Windows 10 you'd be surprised at the number of glitches, apart from being a spyware program in its entirety. Congratulations to all of you. I have taken note of a great sentence that I have been given: "It is a question of being in the right place and at the right time to do what is right."

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Regequion wrote:

                And if you read my blog

                Well, we probably would if it was not so well hidden.

                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