Controlling the Debugger
Besides the Debug class, the System.Diagnostics namespace has a Debugger class, whose static methods are used to control the debugger. Arguably, the most useful of all its methods is Break, which causes the code to break in the debugger at the point of the call. This functionality is often used to debug a program’s startup path, in cases where it’s rather inconvenient to have a debugger attached already. For example, some other process may launch your program without leaving you a chance to attach a debugger.
Note: Image File Execution Options
In fact, the problem of debugging a startup path has been around since the early days of Windows. It’s not really a problem, though. The designers of the loader that is used to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access