Skip to Main Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced content levelIntermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
152
|
Chapter 5, Debugging
#38 Customize Visual Studio’s Reaction to Exceptions
HACK
HACK
#38
Customize Visual Studio’s Reaction to
Exceptions Hack #38
Exceptions are a sometimes-frustrating part of debugging and developing.
You can configure Visual Studio to deal differently with certain exceptions.
When debugging a program in Visual Studio, a number of situations may
cause the debugger to enter break mode. When the debugger enters break
mode, program execution is suspended, allowing you—the developer—the
opportunity to examine and change the program variables. With Visual Stu-
dio 2005, you can even alter the program’s underlying source code when in
break mode and have the program continue with the edited source.
A common way that break mode is entered is through breakpoints
[Hack #36].
Another way that break mode is regularly entered is when an exception is
raised that is not handled by your application. Any exception that bubbles
up out of your user code will cause the Visual Studio debugger to display
information about the exception. While you will likely always want to be
notified of an unhandled exception when debugging, you may want to break
when an exception is thrown, regardless of whether or not it’s handled.
Visual Studio can be easily customized to break immediately when a particu-
lar type of exception is thrown.
Use the Exceptions Dialog Box
To customize Visual Studio’s behavior when encountering ...
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.
Start your free trial

You might also like

Microsoft Visual Studio 2015 Unleashed, Third Edition

Microsoft Visual Studio 2015 Unleashed, Third Edition

Mike Snell, Lars Powers
.Net Framework Essentials

.Net Framework Essentials

Thuan L. Thai, Hoang Lam
C# 5.0 Unleashed

C# 5.0 Unleashed

Bart De Smet
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 0596008473Errata Page