I suggest you ...

allow breakpoints to be set on no-body properties.

Often times I am motivated to create properties that have no custom accessor or specifier bodies. For example:

class Person
{
private int _age { get; set; }
}

The advantage of a property over field in this case is that if I ever want to debug how and when _age is being mutated or accessed I can fill in the bodies of get and set with an obligatory backing field:

class Person
{
private int _ageBacking;

private int _age { get { return _ageBacking; } set { _ageBacking = value; }
}

and set breakpoints in the get and set body. Let's bypass the need for the backing field and allow users to set breakpoints on the original property. Even if we can't do any "hovering over" to see the value of the property it is still useful for the breakpoint to be hit just so we can see the current state of the stack when the code interacts with the property.

85 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    MattMatt shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • TobiasTobias commented  ·   ·  Flag as inappropriate

        The correct name of "no-body-properties" is "auto-implemented properties" and I would really, really, really appreciate the feature of setting breakpoints on auto-implemented properties!

      • MattMatt commented  ·   ·  Flag as inappropriate

        As as a side note, if you try this in VS it looks like VS will allow you to set the BP. But when it comes time to actually debug the original position of the BP isn't respected. This is probably a bug.

      Feedback and Knowledge Base