Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In VS2015, how do I disable Step Into for auto-implemented properties?

I've just started using Visual Studio 2015 and found that it behaves differently to VS2012/VS2013 when debugging auto-implemented properties.

Say I have a property defined in a class:

public int MyProperty { get; set; }

ie. an auto-implemented property where the getter and setter are effectively generated by the compiler.

I may refer to this property later on, as part of a method call for example:

{
    DoSomeStuff(MyProperty);
}

If I want to debug the call to DoSomeStuff and put a breakpoint on that line, then wait for it to be hit and F11 to Step Into the call, the VS2015 debugger now steps into the getter for MyProperty (in previous versions, for auto-implemented properties, it would just ignore the getters and setters).

I found a blog post that describes the ability to put breakpoints on auto getters & setters as a new feature, and I can see how that may be useful in some cases. However, in my case I am not interested in breakpointing or stepping into these methods, particularly as our codebase has many auto-implemented properties and access to them is often nested (eg. DoSomeStuff(X.Y.Z)).

In short, is it possible to disable the new Step Into behaviour for auto-implemented properties in VS2015, and if so, how?

(I noticed a "Step over properties and operators" checkbox in the Debugging Options, but I don't want to step over all property getters/setters, just those for auto-implemented properties.)

like image 215
Steven Rands Avatar asked Aug 19 '16 14:08

Steven Rands


1 Answers

Go to the VS2015 options -> debugging -> general and tick "Step over properties and operators".

like image 176
Kinetic Avatar answered Oct 05 '22 00:10

Kinetic