Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Looking at Exceptions in a New Way Using Visualizers
|
427
The other important part of setting up the visualizer infrastructure is that the class
library needs to display the
System.Diagnostics.DebuggerVisualizerAttribute for
each object type it is going to support. To support
System.Exception, the following
attribute is necessary:
[assembly: System.Diagnostics.DebuggerVisualizer(
typeof(ExceptionalVisualizer.ExceptionVisualizer),
typeof(VisualizerObjectSource),
Target = typeof(System.Exception),
Description = "Exception Visualizer")]
The DebuggerVisualizerAttribute can have the properties listed in Table 7-3.
Once the Visualizer is built, it needs to be deployed to one or both of the following
locations:
Visual Studio Install Directory>\Common7\Packages\Debugger\Visualizers (for all
users)
My Documents>\Visual Studio\Visualizers (for the current user)
This is where Visual Studio 2005 looks for the visualizers on debugging startup so
that they can be loaded into the processes. The visualizer is accessed through a
magnifying glass icon when the mouse hovers over an exception object in the
debugger, as shown in Figure 7-9. Select the down arrow and choose the type of visu-
alizer to use. These type names are taken from the
Description property of the
DebuggerVisualizerAttribute.
Discussion
There ...
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

C# Cookbook

C# Cookbook

Joe Mayo
C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata