VS2013调试器+实体框架:"运行时一直拒绝评价表述QUOT ;,崩溃 [英] VS2013 Debugger + Entity Framework: "runtime has refused to evaluate the expression", crashes

查看:321
本文介绍了VS2013调试器+实体框架:"运行时一直拒绝评价表述QUOT ;,崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我调试到对代码单元测试是创下了现场的SQL Server时遇到了很多在VS2013最终调试与实体框架6.0.1的问题。

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.

包含实体变量不能在调试器中查看。例如,如果我执行对我的DbContext LINQ查询并刷新结果中查看实际执行查询,结果值是儿童无法评价。如果我ToArray的(),所以现在的变量是实体,而不是一个IQueryable的数组,每个结果数组中是无法计算表达式。如果我从阵列中的单个实体值存储到一个变量,并尝试查看它,我得到运行时拒绝在这个时间来评估的表达。

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."

通常情况下,通过涉及到实体属性访问一行F10'ing导致Visual Studio崩溃。

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

这不,如果我发生运行针对嘲弄式的假DbSet测试。

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调试器+实体框架:"运行时一直拒绝评价表述QUOT ;,崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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