Home

Visual Studio Visualizers (LINQPad Option?)

Hello All,

Is there a built in way to see LINQPad as a Visualizer in Visual studio? I have seen some outside work like LINQBridgeVs Extension https://visualstudiogallery.msdn.microsoft.com/8ede652c-396f-4dc9-bc4f-c88f9b8291d2, is there anything built in that does this? If not can we add it to the suggestions list?

If I could use LINQPad inside VS when I am debugging, WOW, you how amazing that would be?

Thanks

Comments

  • edited August 2016
    So I have found this: https://linqpad.uservoice.com/forums/18302-linqpad-feature-suggestions/suggestions/447166-make-dump-extension-method-available-in-visual-s

    This seems to be working so far, I will update if there is anything else.

    Steps to get it to work from Joe:
    You can use LINQPad's XHTML Dump engine from within Visual Studio by adding a reference to LINQPad.exe and then doing this:

    var writer = LINQPad.Util.CreateXhtmlWriter();

    To call Dump(), simply call Write or WriteLine on the writer object.

    When you want to view the output. call ToString() on the writer - if you write the output to a file, you can then view it in a web browser.
    Extensions:
    public static class Extensions { /// <summary> /// Dumps to a temporary html file and opens in the browser. /// </summary> /// <param name="o">The object to display.</param> public static void DumpToFile<T>(this T o) { string localUrl = Path.GetTempFileName() + ".html"; using (var writer = LINQPad.Util.CreateXhtmlWriter(true)) { writer.Write(o); File.WriteAllText(localUrl, writer.ToString()); } Process.Start(localUrl); } /// <summary> /// Dumps to debugger. Used in the HTML debug view. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="o">The o.</param> /// <returns></returns> public static string DumpToDebugger<T>(this T o) { var writer = LINQPad.Util.CreateXhtmlWriter(); writer.Write(o); return writer.ToString(); } }
  • I really wish that I didn't have to add things to my project to get this to work. I wish that there was a LinqPad.dll that I could add to my "\Visual Studio 2015\Visualizers" folder and then just have it as an added feature in the debugger.
  • Hi,

    That's not possible. The debugger visualizer dll must know about the types to be mapped (e.g. the types of your project/s), which means a linqpad.dll cannot be just simply dropped in the Visualizers folder.
    Disclaimer: I'm the author of LINQBridgeVs
Sign In or Register to comment.