• Register
0 votes

Problem :

I am using the Visual Studio 2010 in a debug mode and I have "optimize code" unchecked. I am unable to quick watch (or hover on) any variable in my debugger. I encountered following error "Cannot evaluate expression because the code of the current method is optimized".

Even the line like: int i = -3, doing the quick watch on i, I encountered following error "Cannot obtain value of local or argument 'i' as it is not available at this instruction pointer, possibly because it has been optimized away."

Am I missing any setting here ?

7 5 2
3,870 points

1 Answer

0 votes

Solution :

While my project was in the debug mode, my solution was not. So when I changed it, everything worked for me.


I had this same issue when I was using the VS 2010. My solution configuration has a (Debug) selected. I resolved this by simply unchecking a Optimize Code property under a project properties. Follow it  Project (right Click)=> Properties => Build (tab) => uncheck Optimize code


In the VS2013 go to: Tools -> Options -> Debugging -> General and enable the 'Use managed compatibility mode'. This disables your new function evaluation behavior.

Hope above solutions help you in resolving your issue.

9 7 4
38,600 points

Related questions

1 vote
1 answer 35 views
Problem : I am unable to build my projects as I am facing below message: “Unable to find manifest signing certificate in the certificate store”. I have tried to run my Visual Studio as the Administrator and also I have tried to manually add my keys to ... Project Properties but above error is still appearing. I am unable to fix above error. Can someone guide me in fixing above error?
asked Apr 4 morrisBson 3.2k points
0 votes
1 answer 49 views
Problem : I have recently installed the Visual Studio 2012 Release Preview, and it works fine, however now when I want to use Visual Studio 2010 to compile my C++ projects, I am facing below error message: LINK : fatal error LNK1123: failure during conversion to ... tried to uninstall my Visual Studio 2012 and rebooted my box but the problem still persists!. Does anyone has any solution on it.
asked Dec 6, 2019 alecxe 7.5k points
0 votes
1 answer 135 views
Problem : I am troubled by following error skipped loading symbols. module is optimized and the debugger option 'just my code' is enabled.
asked Nov 13, 2019 peterlaw 6.9k points