Reputation: 20279
I'm trying to debug lambda expressions with Visual Studio 2015 while in debug mode on an Android device. If I put
this.customerList.Where(p => p.LastName == "Doe").ToList()
in the Watch or Immediate Window I get
Expression not supported.
I'm doing this after the debugger stopped at the breakpoint. If I don't use the breakpoint I get
The expression cannot be evaluated while in run mode.
What I'm doing wrong?
The options stated in lambda expressions in immediate window for VS2015 are grayed out and not ticked, while in debug mode.
Edit
I tried the example code from Tatranskymedved with the same result:
My guess is that debugging lambda expression is not possible with Xamarin. I tried it on device and on simulator and both are showing the same result. Another possibility would be that I have to change some debugger settings. Here I tried to disable Use Fast Deployment (debug mode only)
and Use Shared Runtime
without success.
Upvotes: 4
Views: 4034
Reputation: 4371
After running several tests (no post/article on this topic found as a reference), I came to verdict that debugging of Lambda expressions does not work on Xamarin with Xamarin debugger.
Same code/expression does normally work on standard application:
This seems to be unrelated to version of .NET, as downgrading to version 4.0 (on Console app), still provide same debug results.
I have noted that in properties of Android project, there is an option called "debugger" and values to choose from: Xamarin, Microsoft Standard debug of Console app is most likely with the Microsoft one - which might have full support of debugging the Lambda expression.
Upvotes: 5