Diagnostic Debugger Output
Another capability of the
System.Diagnostics namespace is to interact with a debugger from inside your code. Samples include emitting diagnostic information about what your code is doing, which can be visualized in a debugger’s output window. Let’s take a look at some of those capabilities.
Debug class, notice the presence of
WriteLine methods. Using them, you can write information to the debugger. Just as with
Assert calls, the calls to those methods are omitted from the assembly if it isn’t built using the
DEBUG flag, so there’s no runtime overhead in release build binaries. An example is shown here:
Conditional Debugger Output
WriteLine exist, with an
If suffix. Besides ...