I have a break point set after I have assigned a value to a local variable. The name of the variable remains grayed out, and I can't see its value when I hover over it. This was working find but has suddenly stopped.
As shown in the code below, I have set two break points, one where I add together two local variables, and one when I instantiate a form. The debugger does not halt at the first break point, but does at the second. When I hover over any of the local variables, I get not recognition of the variable nor its value.
int testVariable = 1;
int test2 = 3;
int test3 = 0;
test3 = testVariable+test2; //this is where the breakpoint is - note test3 is grayed out
MainForm main = new MainForm(); // this where the second breakpoint is which does work
main.Show();
Hover over a variable to see its value. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable. If the variable is an object, you can expand the object by clicking on the arrow to see the elements of that object.
Locals While debugging you can enable 'Locals' which will show you all variables in the current stack frame. Go to menu Debug->Windows->Locals to make it appear. Watch Although it is a little manually you also can use 'Watch' you can drag and drop any variable to this window or right click then add to watch.
This was working find but has suddenly stopped.
Did you make any changes to your project recently? Nothing is special with your code, I assume this is an issue with your settings or extensions. You can try steps below to resolve this issue:
You can try restarting VS and rebuilding the project.
If it persists, please reset all your debug-related options (Tools -> Import and Export settings -> Reset all settings ->No, just reset...).
If it not works, go Tools -> Options -> Debugging -> General to check both "Use the legacy C# and VB expression evaluators" and "Use Managed Compatibility Mode".
Also, according to this document, please avoid debugging optimized code, you can enable the "Suppress JIT optimizations on module load (Managed only)" option to check if it helps.
The problem I had that I was executing the application in release mode, changing it to Debug resolved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With