I suggest you ...

Setting breakpoints on auto-implemented 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.

131 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 →
    jancsi03jancsi03 shared a merged idea: Allow debugger break into property short hand getter and setter  ·   · 

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

      Feedback and Knowledge Base