...

/

Debugging During Development and Setting Breakpoint

Debugging During Development and Setting Breakpoint

Learn about debugging techniques, including using code editors, setting breakpoints, toggling breakpoints, and utilizing debugging tools.

We will learn how to debug problems at development time. Using a code editor with debugging tools, such as Visual Studio 2022 or Visual Studio Code, would be best. At the time of writing, we cannot use .NET Interactive Notebooks to debug code, but this is expected to be added.

Note: Some people find setting up the OmniSharp debugger for Visual Studio Code tricky. We have included instructions for the most common issues, but if you still have trouble, try reading the information.

Using the Visual Studio Code integrated terminal during debugging

By default, OmniSharp sets the console to use the internal console during debugging, which does not allow interactions like entering text from the ReadLine method. To improve the experience, we can change a setting to use the integrated terminal instead:

Step 1: In any project where we want to set breakpoints and step through code, in the .vscode folder, open the launch.json file.

Step 2: Change the console setting from internalConsole to ...