To debug your code, you need methods or properties, which are provided by Debug Class in C#.
The debugger class is used to set communication with the debugger.
Debug Class
The Debug class inherits from System.Diagnostics. The syntax is −
public static class Debug
The following are the properties of the debugger class.
| Sr.No | Property & Description |
|---|---|
| 1 | AutoFlush Gets or sets a value stating whether Flush should be called on the Listeners or not. |
| 2 | IndentLevel The indent level is set |
| 3 | IndetntSize The number of spaces in the indent |
| 4 | Listeners Get the collection of listeners |
Debugger Class
The Debugger class also inherits from System.Diagnostics but it enables communication with the debugger and it cannot be inherited.
The following is the syntax −
public sealed class Debugger
It has only one property.
| Sr.No | Property & Description |
|---|---|
| 1 | IsAttached Indicates whether a debugger is attached to the process. |