A debugger pauses an ASP.NET Core application at a chosen statement, then lets you inspect and control execution while investigating what the program is doing. section 4.5
Use a debugger by:
- Opening Program.cs in the project. section 4.5
- Toggling a breakpoint on a code statement through Debug > Toggle Breakpoint in Visual Studio or Run > Toggle Breakpoint in Visual Studio Code. section 4.5
- Starting debugging and continuing until execution reaches the breakpoint. section 4.5
- Controlling execution with debugger menus or the displayed controls. section 4.5
A practical alternative
For quick investigation, run the application with dotnet run and add Console.WriteLine statements. Serialize an object to JSON and write the result when its contents need inspection. This is especially useful when an if condition prevents a statement from being called. section 4.5
Figure 4.7 Setting a breakpoint
A breakpoint appears as a red dot beside the selected statement. section 4.5





