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?

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


Result in LinqPad
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ""> <html xmlns=""> <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


  • I don't understand what you're trying to do.
  • edited April 2013
    - I implemented DUMP function in MYPROJECT and one of MYFUNCTION uses that DUMP function.
    - added MYPROJECT's reference into LINQPAD and called MYFUNCTION in it.
    - result comes to screen as HTML formatted raw string instead of rendered tables.

    How can I force LinqPad to render that result?
  • Why not just call LINQPad's Dump method directly from MYFUNCTION? You don't need to write your own Dump method.

    Or else, call Console.WriteLine. LINQPad redirects Console.Out to the Dump function.
  • edited April 2013
    My bad, I didn't check that. Thanks
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!