Thursday, August 02, 2007

Visual Studio debugger trick

In order to show a custom string when viewing a custom object in the visual studio debugger,

you can attribute the class with
[[DebuggerDisplay("sometext")]]
if sometext includes "{parametername}" the value of the parameter with the given name (parametername in this case) will be shown at that point.

If you need more control than that, you can always build a custom debugger visualizer (google it)