VS2013 Debugger + Entity Framework: “runtime has refused to evaluate the expression”, crashes

前端 未结 5 1410
小鲜肉
小鲜肉 2020-12-29 19:04

I\'m experiencing a lot of problems with Entity Framework 6.0.1 in the VS2013 Ultimate debugger when debugging into unit tests against code that\'s hitting a live SQL Server

5条回答
  •  北海茫月
    2020-12-29 19:36

    Shortly after installing VS2013, I also encountered the error

    "Could not evaluate expression"

    for numerous variables while debugging an older VS2012 solution (none of the code involved the entity framework).

    The fix that worked was deleting the two Solution User Options (*.suo) files associated with the solution file. For example, for MySolution.sln, the two corresponding files were:

    • MySolution.v11.suo (VS2012 version)
    • MySolution.v12.suo (VS2013 version)

    It seems that the v12 version might have been corrupted when it was initially created using the settings from the v11 version. Hence, deleting both of them allowed for a new clean .suo file to be created for VS2013 and the problem went away.

    (Note, the .suo files are marked as hidden on Windows 7 so you might not easily see them in Windows Explorer without either changing the settings to show them or using the command line to view them.)

提交回复
热议问题