How do I change the output in the debugger for a class?
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 att开发者_运维问答ribute that can be specified on the class?
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.
精彩评论