Using LINQ in Visual Studio QuickWatch with WCF objects

Viewed 241

In my code, I create an array of objects. Those objects come from WCF.

var people = GetPeopleFromWCF().ToArray();

I set the breakpoint after array assigning, run the debugger, the code is paused in the proper breakpoint. I go to the QuickWatch window and can discover the array objects properties. When I use some LINQ methods in the QuickWatch window like

people.Select(x => x.DateOfBirth), results

or people.Select(x => x.DateOfBirth).ToList()

or people.Select(x => x.DateOfBirth).ToArray()

I got the next error:

Evaluation of method System.Linq.SystemCore_EnumerableDebugView`1[System.DateTime].get_Items() calls into native method Microsoft.Win32.SafeNativeMethods.QueryPerformanceCounter(long&). Evaluation of native methods in this context is not supported.

When in the QuickWatch window I type people.First().DateOfBirth - I got the proper result.

I use Microsoft Visual Studio Enterprise 2019 Version 16.7.3.

What am I doing wrong?

0 Answers
Related