VS2015 Preview: Debugger support for lambdas and LINQ

If you’ve ever tried running a lambda expression in the Immediate Window or as a Watch, you’ll be pretty familiar with the response, “Expression cannot contain lambda expressions” (shown below in VS2012). If you try LINQ, you instead get “Expression cannot contain query expressions”, which is no better.

vs2012-lambda-immediate-window

This changes in Visual Studio 2015, which adds debugger support for lambda expressions and LINQ. VS2015 happily runs lambdas in both the Immediate Window and as Watches:

vs2015-lambda-immediate-window

LINQ works just as happily:

vs2015-linq-immediate-window

So there you go: another much-anticipated and extremely useful feature coming in Visual Studio 2015.

5 thoughts on “VS2015 Preview: Debugger support for lambdas and LINQ”

  1. Hi,
    i am still getting the error:
    error CS1061: ‘…’ does not contain a definition for ‘Where’ and no extension method ‘Where’ accepting a first argument of type ‘…’ could be found (are you missing a using directive or an assembly reference?)
    like in VS2013. Any Idea why?

        1. Can you paste the code you’re trying to use? Maybe you’re giving it an invalid argument… I’m finding it strange that it’s complaining about the type of its first argument.

Leave a Reply

Your email address will not be published. Required fields are marked *