Visual Studio 2015 Debugging: Can't expand local variables?

I'm using Visual Studio 2015 preview, and I'm trying to debug my project. I was using VS 2012 previously, and depended largely on being able to hover over and expand local variables to look at their values. I'm trying to do this in 2015 now, but when I hover over a variable, the box that shows up only says "(local variable) Classname variablename" (e.g. "(local variable) String title"). There is no expand button, and it doesn't show the value of the variable in the box.

Is there a setting I have to change in order to be able to hover over variables and expand them?


Solution 1:

It might be a bug. Please file a Connect bug with a repro if you have one.

In the meantime, you might be able to workaround the problem by setting the debugger options to use the legacy debug engine: Tools -> Options -> Debugging -> General: check both "Use the legacy C# and VB expression evaluators" and "Use Managed Compatibility Mode".

That workaround has worked for me every time. But please, do still file the bugs!

Options window

Solution 2:

I had a similar issue where when I hovered over my local variable, some would let me dive deeper and some would not show anything. After some digging I found an article on msdn here, that suggested resetting the settings in VS. Once I did that, I got a notice that I was running in Release mode and that some debugging features may not be available. Once I changed to Debug mode, everything worked like normal.

Hopefully this will work for you as well.

Solution 3:

As described here, you need to enable the check “Suppress JIT optimizations on module load (Managed only)” in Debug --> Options --> Debugging --> General.

You need also to remove the "Optimize code" flag in the properties of your projects.

Solution 4:

I was having a similar issue in VS2015 where some variables would show the debug values, others wouldn't show anything when hovered over.

Enabling the following setting from Andrew Arnott solved my issue: Tools -> Options -> Debugging -> General: "Use the legacy C# and VB expression evaluators"