cwmartz
cwmartz

Reputation: 302

variable values not showing during debug vs 2019 16.2.4

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();

Upvotes: 26

Views: 52798

Answers (3)

Jeson Martajaya
Jeson Martajaya

Reputation: 7352

This happened to my after updating VS2019 to 16.11.21 . Tried reset all settings, suspend resharper, checked Use Managed Compatibility mode. None worked.

The one that works for me is to delete the hidden .vs folder in my project folder.

Once I deleted it, reopen the project, and DataTip returns back to normal.

Upvotes: 15

LoLance
LoLance

Reputation: 28196

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:

  1. You can try restarting VS and rebuilding the project.

  2. If it persists, please reset all your debug-related options (Tools -> Import and Export settings -> Reset all settings ->No, just reset...).

  3. 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.

Upvotes: 26

Ramzi Hammouda
Ramzi Hammouda

Reputation: 462

The problem I had that I was executing the application in release mode, changing it to Debug resolved the issue.

Upvotes: 30

Related Questions