Reputation: 54202
The ToString() method for a class outputs the class information in the debugger but it has the unfortunate side effect of changing the output for the User Interface (UI). Is there an attribute that can be specified on the class?
Upvotes: 0
Views: 89
Reputation: 54202
Use the attribute DebuggerDisplay
[DebuggerDisplay("AnyString: {MyVar}")]
This code will have the debugger for your class display:
AnyString: 12
where MyVar has been assigned the value 12.
Upvotes: 4