VS2013 Debugger + Entity Framework:“运行时拒绝评估表达式”,崩溃 [英] VS2013 Debugger + Entity Framework: "runtime has refused to evaluate the expression", crashes

查看:166
本文介绍了VS2013 Debugger + Entity Framework:“运行时拒绝评估表达式”,崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在VS2013 Ultimate调试器中遇到了许多问题,调试到单元测试>在调试器中无法查看包含实体的变量。例如,如果我对我的DbContext执行LINQ查询并刷新结果视图来实际执行查询,那么结果值就是无法评估的孩子。如果我的ToArray()它,所以现在该变量是一个数组的实体,而不是一个IQueryable,数组中的每个结果是无法评估表达式。如果我将该数组中的单个实体值存储到一个变量并尝试查看它,我得到运行时目前拒绝评估表达式。





通常,通过涉及访问实体属性的行F10,会导致Visual Studio崩溃。



如果我是运行测试对一个嘲弄的假DbSet。



这是一个已知的问题吗?有没有办法解决这个问题?

解决方案

我有一个类似的问题,虽然我还没有明白为什么, 选项 - >调试 - >常规 - >使用托管兼容模式 - 打开,让我继续正常调试。



我发现这个选项通过这个博客


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.

Variables that contain entities can't be viewed in the debugger. For example, if I execute a LINQ query against my DbContext and refresh the results view to actually execute the query, the Results value is "children could not be evaluated". If I ToArray() it, so now the variable is an array of entities instead of an IQueryable, each result in the array is "Could not evaluate expression". If I store a single entity value from that array to a variable and try to view it, I get "The runtime has refused to evaluate the expression at this time."

Frequently, F10'ing through a line that involves access to an entity property causes Visual Studio to crash.

This doesn't happen if I'm running the test against a mocked-up fake DbSet.

Is this a known issue? Is there a way to fix this?

解决方案

I am having a similar problem and although I'm yet to understand why, turning Options -> Debugging -> General -> Use Managed Compatibility Mode - On, allowed me to continue debugging as normal.

I found this option via this blog post.

这篇关于VS2013 Debugger + Entity Framework:“运行时拒绝评估表达式”,崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆