Home

LinqPad Dump from DLL

I would like to be able to call Dump from my DLL and code below returns raw HTML result. How can I render it, or what is the correct approach?

Method
public static string Dump<T>(this T obj) { var writer = LINQPad.Util.CreateXhtmlWriter(); writer.Write(obj); return writer.ToString(); }

Call
Debug.WriteLine(myObject.Dump());

Result in LinqPad
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta name="Generator" content="LINQ to XML, baby!" /> <style type='text/css'> ... </style> </head> <body> <div> ... </div> </body> </html>

P.S.: StackOverflow link http://goo.gl/D8Rwq

Comments

Sign In or Register to comment.