Debugging tools
In this section, you will learn how to debug problems at design time, trace problems at runtime, and use types such as Debug
, Trace
, Process
, and Stopwatch
that are in the System.Diagnostics
namespace.
Debugging an application
For Visual Studio 2017, press Ctrl + Shift + N, or navigate to File | New | Project....
In the New Project dialog, from the Installed | Templates list, select Visual C#. In the list at the center, select Console App (.NET Core), type the name Ch05_Debugging
, change the location to C:\Code
, type the solution name Chapter05
, and then click on OK.
For Visual Studio Code, create a new folder named Chapter05
, create a new subfolder named Ch05_Debugging
, and open the folder in Visual Studio Code. In the Integrated Terminal pane, enter the dotnet new console
command, and restore packages.
Modify the template code to look like this:
using static System.Console; namespace Ch05_Debugging { class Program { static double...