In the preceding examples related to the Debug
class (and consequently related to the Trace
class too), we saw how to send the output of the debugger to the Output window. The .NET Framework enables sending the output to other targets, known as trace listeners. A trace listener is basically an object that “listens” to what is happening at debugging time and then collects information under various forms. For example, you could collect information as XML files or just send such information to the Output window. Both Debug
and Trace
classes expose a property named Listeners
that represents a set of built-in listeners. Table 5.3 groups the .NET Framework built-in listeners.
Table 5.3 .NET Built-In Trace Listeners
No credit card required