"由于当前方法的代码进行了优化"无法计算表达式;在Visual Studio 2010 [英] "Cannot evaluate expression because the code of the current method is optimized" in Visual Studio 2010
问题描述
我使用在调试模式下Visual Studio 2010和我有优化代码选中。我不能快速监视(或悬停)在调试器中的任何变量。我得到这个错误,因为当前方法的代码进行了优化无法计算表达式
I am using Visual Studio 2010 in debug mode and I have "optimize code" unchecked. I can't quick watch (or hover on) any variable in the debugger. I get this error "Cannot evaluate expression because the code of the current method is optimized".
即使像一条线中:int i = -3,做一个快速的手表我,我得到无法获取本地或说法'我',因为它不是可在这个指令指针,可能是因为它已被优化掉。值
Even a line like: int i = -3, doing a quick watch on i, I get "Cannot obtain value of local or argument 'i' as it is not available at this instruction pointer, possibly because it has been optimized away."
这在类似的问题中引用链接似乎并不适用
This link referenced in a similar question doesn't seem to apply.
有没有我缺少一个设置?
Is there a setting I am missing?
推荐答案
虽然该项目是在调试模式下,该解决方案不是。当我改变了它,它的工作。
While the project was in debug mode, the solution was not. When I changed it, it worked.
这篇关于"由于当前方法的代码进行了优化"无法计算表达式;在Visual Studio 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!