Debugging with Breakpoints in Visual Studio
Why Stack Overflow recommends it
Stack Overflow users link it when answering beginners who are stuck on null references, wrong values or index errors and need to learn how to set breakpoints and inspect variables in Visual Studio.
Recommended by 5 people across 4 different months, 2016 to 2022.
What it is
A 16-minute screencast from the Code Insights channel showing how to debug in Visual Studio using breakpoints. It starts with basic breakpoints and moves on to the breakpoint pane, conditional breakpoints, filters and hit counters.
What people said
Recommends CodingYoshi · 2016-11 · Stack Overflow · on “The gridview data in my web application is not corresponding to the selection chosen from the dropdownlist”
Learn how to do that before you write another line of code. Here is a youtube video which will show you all this: [this video]
Recommends Renatas M. · 2017-03 · Stack Overflow · on “.Net MVC not sorting”
@yondaimehokage then you started to learn from the wrong spot. You know how to compile code, next step - breakpoints and debugging your code [this video] . And in short put the breakpoint on if line, hit start debug a(F5) and when you hit breakpoint, move mouse over variables and use step over (F10) to navigate to next line.
Recommends Chedy2149 · 2017-06 · Stack Overflow · on “c# - object reference not set to an instance of an object - LINQ”
It seems that one of the objects manipulated in the action method is null, try to use the VS Debugger to figure out which one is it.https: [this video]
Recommends Robert Petz · 2017-06 · Stack Overflow · on “UWP serial port communication for character write and read (UWP and Arduino)”
That is not what I am asking about at all. Put a breakpoint in your code on that line. Hover over the object `devices`. Then *inside of Visual Studio* examine the contents of that collection to determine what is inside of it. Here [this video] is a basic video explaining how to debug something using Visual Studio.
Recommends ispiro · 2022-04 · Stack Overflow · on “Why does saving args[0] into a string give out a index-out-of-range exception?”
@Matto58 The best thing for you to do now it to see this youtube video [this video] I set it to the correct time in the video to show you how to put a breakpoint. Breakpoints can be immensely helpful. After setting a breakpoint and running, Visual Studio will stop at that line and then you can hover over variables to see their values.