Reputation: 36915
I have a seemingly innocent code snippet, which I typed into Visual Studio 2008 Immediate Window.
? results.Join(lstDocs, Function(docID) docID)
Evaluation of lambda expressions is not valid in the debugger.
As the message says, it's not possible to call a lambda expression in the debugger.
Why is it not allowed?
Upvotes: 8
Views: 3650
Reputation: 241651
Here: Why is LINQ absent from debugger windows?
And this previous question: VS debugging “quick watch” tool and lambda expressions
In short, complexity.
Upvotes: 5
Reputation: 7200
http://msdn.microsoft.com/en-us/library/bb763138.aspx
It's impossible by design. Lambda expressions need to generate code on the fly in the immediate window. The debugger and/or evaluater cannot handle this. If you really want to know why, ask the developers of VS. Maybe this is an upcoming feature somewhen. Lambda expressions is a bearly new feature
Upvotes: 1