Geeks With Blogs

News My Blog has been MOVED to
Michael Freidgeim's OLD Blog My Blog has been MOVED to

For debugging purposes me and my collegue wanted to dump details of the arbitrary object, and created function that uses LINQPad Dump functionality (thanks to and original discussion)
   public static string DumpToHtmlString<T>(this T objectToSerialize)
           string strHTML =

               var writer = LINQPad.
               strHTML = writer.ToString();
           catch (
Exception exc)
Debug.Assert(false, "Investigate why ?" + exc);

           return strHTML;

You will need to add the linqpad executable as a reference in your project.

TO DO similar in plain text ,look at StringExtensions , e.g. JsonSerializer/CsvSerializer


Posted on Saturday, April 14, 2012 2:50 PM ASP.NET , .Net Framework , Testing/Debugging/Logging | Back to top

Comments on this post: Dump an arbitrary object To Html String

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: