What does quot;Cannot evaluate expression because the code of the current method is optimized.quot; mean?(“无法评估表达式,因为当前方法的代码已优化.是什么意思?意思是?)
问题描述
我编写了一些包含大量递归的代码,这需要相当长的时间才能完成.每当我暂停"运行以查看发生了什么时,我都会得到:
<块引用><块引用>无法计算表达式,因为当前方法的代码已经过优化.
我想我明白这意味着什么.然而,令我困惑的是,在我点击 step 之后,代码不再优化",我可以查看我的变量.这是怎么发生的?代码如何在优化代码和非优化代码之间来回翻转?
Debugger使用FuncEval让你看"变量.FuncEval 要求在托管代码中的 GarbageCollector 安全点停止线程.手动暂停"IDE 中的运行会导致所有线程尽快停止.您的高度递归代码往往会停在不安全的地方.因此,调试器无法评估表达式.
按 F10 将移动到下一个功能安全点并启用功能评估.
有关详细信息,请查看 FuncEval 规则一个>.
I wrote some code with a lot of recursion, that takes quite a bit of time to complete. Whenever I "pause" the run to look at what's going on I get:
Cannot evaluate expression because the code of the current method is optimized.
I think I understand what that means. However, what puzzles me is that after I hit step, the code is not "optimized" anymore, and I can look at my variables. How does this happen? How can the code flip back and forth between optimized and non-optimzed code?
The Debugger uses FuncEval to allow you to "look at" variables. FuncEval requires threads to be stopped in managed code at a GarbageCollector safe point. Manually "pausing" the run in the IDE causes all threads to stop as soon as possible. Your highly recursive code will tend to stop at an unsafe point. Hence, the debugger is unable to evaluate expressions.
Pressing F10 will move to the next Funceval Safe point and will enable function evaluation.
For further information review the rules of FuncEval.
这篇关于“无法评估表达式,因为当前方法的代码已优化."是什么意思?意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“无法评估表达式,因为当前方法的代码已优化."是什么意思?意思是?
基础教程推荐
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- c# Math.Sqrt 实现 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01