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
I had a similar issue. My class had an ToString() override and it still didn't show up in VS, which was odd.
Adding the attribute [System.Diagnostics.DebuggerDisplay("{ToString()}")] to the class showed an exception in the visual studio debugger, where the ToString should have displayed. Turned out I had a bug with incorrectly using string.Format() in my implementation. This is an interesting behavior - VS reverts to the default ToString in case of an exception. The usage of the mentioned attribute forces the display to show the method's output - valid or exception. This is very useful for debugging ToString(). Otherwise there is no point in adding this attribute explicitly to each class since classes have it turned on by default, unless one wants to turn this behavior off for some reason.