Why would Visual Studio 2010 say it can't show a variable during debug?
In Visual Studio 2010 sometimes when I want to get the value of a variable while debugging, it tells me that it "does not exist in t开发者_开发知识库his context" when it obviously does.
I have found that if I use the variable, as in the screenshot below, then it is able to show it.
Has anyone experienced this? Visual Studio 2008 never did this.
How can I get Visual Studio 2010 to always show me variable values while debugging?
alt text http://www.deviantsart.com/upload/jcnr1s.png
Hazarding a guess..
Could it be that your running in Release mode and the variable has been optimized out? Once you actually use the value, then it no longer can optimize the value out?
Is GetListOfFileNames() deferring execution? Try tacking .ToList() on it.
精彩评论