Can't set breakpoints on an auto-property setter ? Why?

Posted by Cristi Diaconescu on Stack Overflow See other posts from Stack Overflow or by Cristi Diaconescu
Published on 2010-04-21T11:57:50Z Indexed on 2010/04/29 21:57 UTC
Read the original article Hit count: 497

Apparently VS 2008 does not allow setting a breakpoint just on the setter of an auto-property.

I.e. if I define an auto-property like this:

    public int CurrentFramesize
    {
        get; 
        protected set;
    }

and then try to set a breakpoint on the setter line, the whole auto-property turns breakpoint-red.

This works just fine for normal properties, so any idea why auto-properties get this special (restrictive) treatment? Are they more than just syntactic sugar to normal properties with a hidden backing field?

© Stack Overflow or respective owner

Related posts about .net-3.5

Related posts about auto-properties