In older versions of VS, the locals/watch/autos/etc windows would reflect the inheritance tree of whatever you were looking at:
This had the benefit that you would only see up front the locally added variables to whatever you were dealing with, which is what I'm interested in nearly always.
Now, it flattens it and puts everything in one big list:
Which, if you are dealing with anything such as Windows Forms or are subclassing anything with a deep inheritance tree, that means you constantly have to wade through a ton of garbage that is never going to be important, every single time you need to look at something.
Essentially, it seems for VS2015 they did this: Flatten inherited members in Visual Studio's Watch window? and made it the only option, and I want to do the reverse of that. Sure, occasionally it's nice to quickly dive deep in the inheritance tree, but I want to only dive shallow about 1000x as often.
I didn't see anything that obviously controls this behavior in the General Debugging settings, is there any other way to switch the behavior?
The Autos and Locals windows show variable values while you are debugging. The windows are only available during a debugging session. The Autos window shows variables used around the current breakpoint. The Locals window shows variables defined in the local scope, which is usually the current function or method.
To open the Locals window, while debugging, select Debug > Windows > Locals, or press Alt+4. This topic applies to Visual Studio on Windows.
Luckily there is one.
namespace Test
{
public class A
{
public int Foo { get; set; }
}
public class B : A
{
public int Bar { get; set; }
}
class Program
{
static void Main(string[] args)
{
var a = new B();
}
}
}
Documentation (not quite useful):
Use the legacy C# and VB expression evaluators
The debugger will use the Visual Studio 2013 C#/VB expression evaluators instead of the Visual Studio 2015 Roslyn-based expression evaluators.
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