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