Debugging Lamda Expressions with Visual Studio 2015

Ladies and gentlemen, we have finally reached the holy grail of debugging!

I don’t know whose idea it was not not mention this during today’s Connect(); event, but here’s one new feature of Visual Studio 2015 that, personally, I feel should have made the keynote.

Visual Studio 2015 now supports debugging lamda expressions!!!! and even more at Support for debugging lambda expressions with Visual Studio 2015 – Microsoft Application Lifecycle Management – Site Home – MSDN Blogs

Let’s see how it can blow our minds!

Here, Visual Studio 2015 politely stopped the execution of this code because there’s a needle somewhere in our hay stack…

Prior to Visual Studio 2015, it would have been quite the pain trying to figure out where the “needle” is at this point.

Prior to Visual Studio 2015, it would have been impossible to run this code in the immediate window to easily discover that our needle is hiding in index 478!

That’s awesome! But we can do better!

With a light modification in the immediate window, we can see that there’s exactly one needle, its index, and the full string that contains the “needle”:

The number of times I’ve wanted to be able to perform that kind of debugging is staggering…