C#: Printing all properties of an object [duplicate]

Is there a method built into .NET that can write all the properties and such of an object to the console?

One could make use of reflection of course, but I’m curious if this already exists…especially since you can do it in Visual Studio in the Immediate Window. There you can type an object name (while in debug mode), press enter, and it is printed fairly prettily with all its stuff.

Does a method like this exist?

9 Answers
9

Leave a Comment