开发者

How do I change the output in the debugger for a class?

开发者 https://www.devze.com 2023-03-26 03:53 出处:网络
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开发者_运维问答

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

精彩评论

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