Debugging during development
In this section, you will learn how to debug problems at development time.
More Information: It can be tricky setting up the OmniSharp debugger for Visual Studio Code. If you have trouble, try reading the information at the following link: https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger.md
Creating code with a deliberate bug
Let's explore debugging by creating a console app with a deliberate bug that we will then use the OmniSharp debugger tools to track down and fix:
- In
Chapter04
, create a folder namedDebugging
, add it to the workspace, and create a console application in the folder. - Navigate to View | Command Palette, enter and select OmniSharp: Select Project, and then select the Debugging project.
- When you see the pop-up warning message saying that required assets are missing, click Yes to add them.
- In the
Debugging
folder, open and modifyProgram.cs
to define a function...