Reputation: 2642
I have builder class that generates a string. The output string is available through the ToString()
method. I want to show this output in visual studio's debugger.
When I take a look at the raw string I get the following result:
When I look at the builder however it is missing the newlines as well as the "View" button:
Adding [DebuggerDisplay("{ToString()}")]
to the at least shows the newlines, but still doesn't have the "View" button.
How can I make my class automatically display itself exactly like the string, including the "View" button?
Upvotes: 8
Views: 465
Reputation: 442
Seems like you need to add a DebuggerTypeProxyAttribute to your builder class. It's not very pretty but it sounds like that is what you need.
Here is another SO-question to look at.
Upvotes: 1