views:

48

answers:

2

Does anybody know a class, that writes the structure(public (static, instance) members)/data of an object/class to string (for debugging-purposes) or even generate fancy html-divs or something like that?

A: 

I don't know of any vendor packages off the top of my head, but the XmlSerializer would do that for you pretty easily.

John Kraft
`XmlSerializer` won't work for all types.
John Saunders
A: 

Well, the obvious answer is to use the debugger build into Visual Studio, it has some wonderful tools (Watches, Quick Watch, Immediate window, etc...) If for some reason you dont have access to the debugger, I suggest you fix whatever it keeping you from it, but otherwise you can write yourself a fairly robust object dumper using Reflection. Or you can take Eric White's advice and use the ObjectDumper.

Check out: http://blogs.msdn.com/ericwhite/archive/2008/08/14/object-dumper-an-invaluable-tool-for-writing-code-in-the-functional-programming-style.aspx

Mr Bell