CLR debugger and 'var'

Posted by Ken on Stack Overflow See other posts from Stack Overflow or by Ken
Published on 2010-04-30T21:18:06Z Indexed on 2010/04/30 21:27 UTC
Read the original article Hit count: 420

Filed under:
|
|

I'm using the CLR debugger (version 8, from "Visual Studio 2005") to debug some C# code. I can step through my code, but for many variables, the debugger won't show me its value. That is, if I type it in the "Immediate" frame or add it to the "Watch" frame, it says "Unable to evaluate the expression.".

It seems to do this a lot for var variables, but I'm also seeing it for parameters and properties, too. I have not been able to figure out what the pattern is.

Is there a rule for when it can display the value of a variable? Is there something I need to do to my code, or in my build script, to make the debugger able to view variables? Or is there a hidden debugger setting?

© Stack Overflow or respective owner

Related posts about c#

Related posts about debugger