How to get ToString() to show up in Debug

前端 未结 7 1075
情话喂你
情话喂你 2020-12-15 21:34

I\'d like to get ToString() to display for a class under my control in debug mode.

It\'d be nice if this was the first thing to show up when you hover over a varia

7条回答
  •  抹茶落季
    2020-12-15 22:15

    There is DebuggerDisplayAttribute which lets you influence the display. It allows you to write fairly complex expressions to produce the debug output, although it is not recommended to do so.

    However, if you have overriden ToString then the debugger is documented to display that by default. Maybe there's something wrong with the code?

提交回复
热议问题