Enumerating IEnumerable in EF6 in debugger issues "Children could not be evaluated" error

asp.net-mvc entity-framework linq

Question

I have a new ASP.NET MVC 5 project and am attempting to query a code first database through a IdentityDbContext.

If I query a particular DbSet and insert a breakpoint, attempting to read the contents of the IEnumerable will result in VS 2013 telling me that the children could not be evaluated.

I did not have this issue in EF5 / MVC 4.

Has something changed as to make evaluating IQueryables and the like impossible in the debugger in EF6?

Thanks

1
7
10/28/2013 10:01:45 AM

Accepted Answer

This is how it works for now, hopefully it will get fixed at some point, but for now you have to "ToList()" stuff via the watch windows. Urgh!

EF Team Triage: The root cause behind this is an external issue with Lazy. We did discuss creating our own re-implementation of Lazy to workaround the issue but at this stage it doesn't seem to justify the effort. If we see more complaints about this in the future we will reconsider.

> The best workaround is to add a ToList() or similar (either in the code or as a Watch) to see the results.

http://entityframework.codeplex.com/workitem/1898

7
3/11/2014 2:57:21 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow