December 2018
Beginner to intermediate
668 pages
15h 30m
English
One trace listener, the DefaultTraceListener class, is configured automatically and writes to Visual Studio 2017's Output pane, or to Visual Studio Code's Debug pane. You can configure others manually using code.
Add a new console application project named Instrumenting.
Modify the template code, as shown in the following code:
using System.Diagnostics; namespace Instrumenting{ class Program { static void Main(string[] args) { Debug.WriteLine("Debug says, I am watching!"); Trace.WriteLine("Trace says, I am watching!"); } }}
Start the console application with the debugger attached.
In Visual Studio 2017's Output window, you will see the two messages. If you cannot see the Output window, press Ctrl +
Read now
Unlock full access