Debugger Display Attributes

With the debugger's Display Attributes feature, you can identify the most useful information about a type you've developed and display this information in the debugger. The DebuggerDisplay attribute controls how a type or member is displayed in the debugger variable windows. These attributes allow the type developer to provide a single-line summary text that may be useful when debugging an application that uses the type. For example, the following could be used on the employee type to display the FullName property:

[DebuggerDisplay("Employee ( {FullName} )")]public class Employee  {    ...  }

The debugger uses this string as a format specification, and replaces items within curly braces with the corresponding data from the object being displayed. The data within the braces can be a field, property, or method, and can have any visibility, so using private members here is permitted.

Similarly, you can use the DebuggerBrowsable attribute to control how a field or property is displayed.