I need to print out an easy to read object graph from Visual Studio because I need to show a customer the state of an object at runtime.
Are ther开发者_运维技巧e any debug visualizers for this? Expanding everything in a quick watch window isn't easy enough for the customer to comprehend.
If you can get by with only one or two key properties. Then you could make use of the DebuggerDisplay attribute a top a class declaration to make formatted text display in the debugger quickwatch line or mouse hover over.
E.g.
[DebuggerDisplay("Applicant - Name = {DisplayName}, EntityId = {EntityId}")]
public class Applicant
{
}
If you are on Visual Studio 2010, take a look at "GCRoot via DGML" extension - http://blogs.msdn.com/mohamedg/archive/2010/03/02/visual-gcroot-via-dgml.aspx.
Try going into the Intermidiate Window (Ctrl+Alt+I) and write "? variableName". Another way is the to use the LinqPad visualizer http://code.google.com/p/linqpadvisualizer/
精彩评论