开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜