When debugging into unit tests against code that is accessing a live SQL Server, Entity Framework 6.0.1 with the VS2013 Ultimate debugger is giving me a lot of issues.
Entity-containing variables cannot be examined in the debugger. For instance, the Results value is "children could not be evaluated" if I run a LINQ query against my DbContext and reload the results view to actually run the query. Each result in the array is "Could not evaluate expression" if I use the ToArray() function, which turns the variable into an array of entities rather than an IQueryable. The runtime has refused to evaluate the expression at this time if I try to view a single entity value from that array that I've stored in a variable.
F10ing across a line with access to an entity property frequently results in Visual Studio crashing.
If I run the test against a mocked-up false DbSet, this doesn't occur.
Is this problem well-known? Can this be fixed in any way?
Although I still don't know why, turning Use Managed Compatibility Mode under Options -> Debugging -> General. - On allowed me to resume debugging even though I was having a similar issue.
I discovered this choice through this blog entry.
I also ran into the error soon after installing VS2013.
"Could not evaluate expression"
while troubleshooting an older VS2012 solution for several variables (none of the code involved the entity framework).
Solution User Options (*.suo)
files linked to the solution file were deleted, and this was the solution that worked. For instance,
the two matching files were as follows:
It appears that the v12 version may have been tainted when it was initially made using the v11 version's settings. Consequently, removing both of them made room for a fresh, clean
the VS2013 file to be produced, and the issue was fixed.
(Note the the
On Windows 7, files can be marked as hidden, making it difficult to access them in Windows Explorer without either altering the settings to make them visible or the command line.)