Create Custom Views of Managed Objects

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Create custom views of managed objects.

You can customize the way Visual Studio displays data types in debugger variable windows.

In C# and Visual Basic, you can add expansions for custom data using DebuggerTypeProxyAttribute, DebuggerDisplayAttribute, and DebuggerBrowsableAttribute.

In .NET Framework 2.0 code, Visual Basic does not support the DebuggerBrowsable attribute. This limitation is removed in more recent versions of the .NET Framework.

You can write a visualizer to display any managed data type. For more information, see How to: Write a Visualizer.

For native code, you can add custom data type expansions to the file autoexp.dat, which is located in the Program Files\Microsoft Visual Studio 11.0\Common7\Packages\Debugger directory. Instructions on how to write autoexp rules are located in the file itself.

System_CAPS_ICON_caution.jpg Caution

The structure of this file and the syntax of autoexp rules might change from one release of Visual Studio to the next.

Native type views can also be customized by writing an expression evaluator add-in. For more information, see EEAddIn Sample: Debugging Expression Evaluator Add-In.

Using DebuggerTypeProxy Attribute
Using the DebuggerDisplay Attribute
Watch and QuickWatch Windows
Enhancing Debugging with the Debugger Display Attributes

Show: