Visual Studio 2015 brings us several long-requested improvements to the debugging process, not the least of which is support for evaluation of lambda expressions. We can finally be rid of the “Expression cannot contain lambda expressions” message that has frustrated many a developer deep in the midst of a debugging session.

There are 3 ways we can now evaluate lambda expressions while debugging: in the watch window, in the immediate window, and directly in a debugger window. Each of them gives us similar options and flexibility, such as error reporting, expansion and enumeration of results, and saving our expressions for future debugging sessions. The best way to see how this works is to view it in action in Visual Studio 2015:

Take a look and then try it out yourself, and enjoy debugging those lambda expressions!

The following two tabs change content below.
A Software Engineer with over 8 years experience, Rachel has experience in circuitry design and automated test systems, but her true passion has always been for software. When she's not at the keyboard developing software, Rachel loves to spend time with her husband and daughters on their cattle ranch enjoying horseback riding, taking photos, and making memories with her extended family.

Latest posts by Rachel Hagerman (see all)