views:

627

answers:

3

I often get in a position when I need to know why my LINQ doesnt work as intended... I use object collections and extensions.

I dont want spend more than couple of minutes on it. LINQ supposed to make developer's life easier not harder.

I hoped VS 2010 will have it fixed but I now use RC and it still doesnt let me type LINQ and check what is going on... Says as before "Expression cannot contain lambda expressions"...

Is there some add-on for Visual Studio so I can quickly and effectively run ad-hoc queries and find out what is going on and where I am wrong?

+1  A: 

Have you tried this?

Debugging LINQ Queries

Debugging LINQ queries can be problematic. One of the reasons is that quite often, you write a large query as a single expression, and you can’t set a breakpoint mid-expression. Writing large queries in expression context is particularly powerful when using functional construction to form XML (or using the strongly typed DOM in Open XML SDK V2). This post presents a little trick that makes it easier to use the debugger with LINQ queries that are written using ‘method syntax’.

Leniel Macaferi
good tip. thanks.
+1  A: 

It's not a VS plugin, but it's free and it's awesome: LinqPad

Check it out here

You can run whatever linq or code snippet in general, just give it a look, it's an incredibly useful tool, for linq and more.

Nick Craver
although this is not exactly what I need (because the main point to use something with VS is to be able to stop at breakpoint and play with existing collection of objects and see what went wrong.... But the pad is brilliant! I read Albahari articles before.. He is cool!
A: 

VS 2010 isn't going to address this..

There is, in fact, such a plugin as you describe, but unfortunately it is highly expiremental. You will probably need to install VS2008 SDK and the Service Packs to get it to work - I know I did..

Here is the link: http://extendedimmediatewin.codeplex.com/

Omer Raviv