Tracing

Tracing enables us to monitor an application while it is executing. When a program is executed, the runtime allows us to write messages to monitor the control flow of the program. This will enable us to identify any incorrect behavior of the application logic. In the case of exceptions, we can identify where exactly the code failed and what variable values caused issues in smooth execution. These messages can be created by the System.Diagnostics.Debug class. When such messages are created, by default, these messages are displayed in the output window of Visual Studio.

Apart from creating these messages, you can redirect these messages to a file or database using the System.Diagnostics.Trace class. You can register listeners using ...

Get Programming in C#: Exam 70-483 (MCSD) Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.