DebuggerDisplay attribute - pdejonghe/DebuggerAttributesConsole GitHub Wiki

DebuggerDisplay attribute on Microsoft Docs

The DebuggerDisplayAttribute controls how an object, property, or field is displayed in the debugger variable windows. This attribute can be applied to types, delegates, properties, fields, and assemblies.

The DebuggerDisplay attribute has a single argument, which is a string to be displayed in the value column for instances of the type. This string can contain braces ({ and }). Text within a pair of braces is evaluated as a field, property or method.

If a class has an overridden ToString() method, the debugger uses the overridden method instead of the default {}. Thus, if you have overridden the ToString() method, the debugger uses the overridden method instead of the default{}, and you do not have to use DebuggerDisplay. If you use both, the DebuggerDisplay attribute takes precedence over the overridden ToString() method.

⚠️ **GitHub.com Fallback** ⚠️