Enhaced debugging with DebuggerDisplay in C#

added by jalpesh
3/19/2014 6:41:02 PM

3 Kicks, 128 Views

We all need to debug our projects and for that we need to some visualization to see values of debug data C# has a attribute called ‘DebuggerDisplay’ which helps developers to visualize data in the way developer wants . As per MSDN, DebuggerDisplay attributes allows developers of the type, who specifies and best understands the runtime behaviour of that type, to also specify what that type will look like when it is display in debugger. How to use DebuggerDisplay attribute: Display attribute constructor has one argument, a string will displayed in the value column for instances of type. This string will contain {} braces and this text between {} will evaluate as expression. So what we are waiting for lets try it in Visual Studio. I have written following code for that.