I am working on a project on VS2010 C++. But somehow the debugger is not showing correct values for many variables in the local/auto/watch windows.
Sometimes it shows correct values after executing another 2-3 statements while in someother case it wouldn't show some variables in auto/local/watch window even if that variable is being used afterwards (i.e. variable is not out of scope due to optimization).
It was working perfectly fine before my computer got Win7 update. I am not sure what all got updated. I tried cleaning and rebuilding but didn't work. I wanted to upload a screenshot but I am in a process of updating to SP1 and don't want to mess up with installation process.
Anyone has idea (I am not sure if SP1 will solve the issue)?
According to your description, I suppose there is an issue with Visual Studio on you side. After installing SP1, please try to reproduce this issue. If this problem still exists, I suggest you refer to the following ways for more information:
1. Open Visual Studio Command Prompt (2010) under Start menu -> All Programs -> Microsoft Visual Studio 2010 -> Visual Studio Tools (run it with Administrator privilege: right-click the program -> Run as administrator);
2. Try some devenv switches in command prompt:
a. Run devenv /Resetsettings to eliminate the cause of corrupted settings.
b. Run devenv /ResetSkipPkgs in Command Prompt.
c. Run devenv /Safemode to see if you can apply it correctly. This can eliminate the possibility that third party Add-ins or packages are causing problems.
3. Reboot the machine in Safe Mode. This can isolate some third party application/driver's interference.
4. Switch and try a new user account. This can rule out the possibility of corrupted user profile.
Finally, I suggest you repairing or reinstalling the Visual Studio 2010.
Helen Zhao [MSFT]
MSDN Community Support | Feedback to us
- 已标记为答案 Helen ZhaoModerator 2012年3月23日 5:00
2012年3月19日 16:57Hi Pierre and Helen,
I set the configuration to "Active(Debug)" from Project Property page and optimizations are disabled (/Od). Yet it had the issue I mentioned above. Simply installing SP1 didn't work.
But I got it working by following steps.
1. Installing SP1.
2. Run command 2a from below comment.
3. Setting Active Solution Configuration from Release to Debug (I thought that setting project configuration from property page does automatically set this option as well as there was only one project in the solution - I think this was the missing piece).
4. Clean and rebuild the solution.
Thanks for the input.
- 已标记为答案 Helen ZhaoModerator 2012年3月23日 4:59