Exception debugging in Visual Studio .NET

Exception debugging in Visual Studio .NET

The Visual Studio debugger offers complete control on what happens when an application throws an exception, or calls a .NET method that throws an exception. You set all the relevant options from inside the Exceptions dialog box, which you bring up with the Debug | Exceptions menu command. This dialog shows all the exceptions in the .NET runtime, subdivided by their namespace. Depending on which node you select, you can decide the behavior of all the exceptions, all the exceptions in a namespace, or each individual exception.For each selected exception or group of exceptions you can decide what happens as soon as the exception is thrown (before the application has a chance to deal with it) and what happens if the exception isn’t handled anywhere in the application (by default the debugger comes into play only in the latter case). Activating the debugger also for exceptions that the application is going to be handle can be useful to debug the error handler, or to catch exceptions that would go unnoticed otherwise. For example, you can activate this option if a procedure performs way too slow and you suspect that the reason is a high number of exceptions it has to deal with.

See also  Redefining Energy Management: Advanced Solutions for Modern Buildings

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist