5

I thoroughly enjoy the amazing power of LINQPAD (thanks, Joseph Albahari!) and particularly LINQPad's Dump method. Frequently I take an existing Visual Studio project and move it into LINQPad for the sole purpose of adding a couple Dump statements to see what the data looks like--though Visual Studio's data popups are certainly useful, the Dump output is just much easier to digest. To do this, I open each file I need from the current project, copy and paste the individual classes over to LINQPad, add assemblies and using statements, attempt to run so that LINQPad will tell me what I missed, and repeat until I find all the orphan references.

This method seems antithetical to the elegant, streamlined nature of LINQPad. Is there an easier way? Any chance of seeing "Import Project" on LINQPad's File menu any time soon? If not, I may end up writing a utility myself...

Michael Sorens
  • 35,361
  • 26
  • 116
  • 172
  • An option to add at least references from a VS project would make good sense. I'll look into this and keep you posted :) – Joe Albahari Nov 11 '10 at 10:57

2 Answers2

4

If you just want to call .Dump() in VS, check out this:

http://code.google.com/p/linqpadvisualizer/

Importing an entire VS project into LINQPad might be impractical... but I'm going to look in to whether just references can easily be copied over from a .csproj.

Joe Albahari
  • 30,118
  • 7
  • 80
  • 91
  • There you have it. From The Man himself. – Sorax Nov 11 '10 at 14:21
  • I appreciate your response, Joe. Your pointer here is quite handy and, in fact, it is very timely for an upcoming article I am writing for Simple-Talk.com. (I have mentioned LINQPad in two or three of my articles already as an indispensable tool!) More to your implied question: calling Dump() is one of two things I want to do, so this addresses half my needs. The other half is truly to move a project over to LINQPad since it is an easier "sandbox" when I want to try out pieces of code. I understand there may be issues doing that but I wanted to spur your creative juices!! – Michael Sorens Nov 12 '10 at 16:11
  • Just wanted to note that I attempted to use LinqPadVisualizer but it does not seem to work in VS2010. Someone else already posted the very same error on the LinqPadVisualizer forum (http://code.google.com/p/linqpadvisualizer/issues/detail?id=2) but there has been no response. And, quite oddly, that forum has no timestamps, so I do not know how long ago that issue was posted! I decided to send a direct email to the author to see if there is any resolution; I will repost if I get further info. – Michael Sorens Nov 12 '10 at 21:48
  • The relevant article I mentioned above was recently published on Simple-Talk.com: [LINQ Secrets Revealed: Chaining and Debugging](http://www.simple-talk.com/dotnet/.net-framework/linq-secrets-revealed-chaining-and-debugging/). In it, I discuss useful and practical techniques for LINQ, LINQPad, and LINQPad Visualizer. – Michael Sorens Jan 19 '11 at 23:45
1

LINQPad is awesome and I also manually import projects occasionally. I haven't heard Mr. Albahari mention anything about "Import Project" functionality. And I'd be surprised if he would be interested in implementing something like this anytime soon.

Of course, he is very receptive to suggestions so I recommend posting your idea in his Nutshell forum which he frequents.

Additionally, check out the TypeSerializer in Service Stack libraries. I believe its Dump extension method is wrapped by LINQPad's which then encodes the output in XHTML. It might just be easier for you to use it directly in your code.

Sorax
  • 2,205
  • 13
  • 14