Why does this code not work?
class Test
{
int Abc { private set; get; }
}
What is the default access modifier for properties?
The Abc property must be public, protected or internal:
public int Abc { get; private set; }
In your case the property is private (because you haven't specified an access modifier) so it's already a private set. You cannot modify its value outside of the current class so it doesn't really make sense to declare a private setter in this case.