This documentation is archived and is not being maintained.

Compiler Error CS0277 

Error Message

'class' does not implement interface member 'accessor'. 'class accessor' is not public

This error occurs when you try to implement a property of an interface, but the implementation of the property accessor in the class is not public. Methods that implement interface members need to have public accessibility. To resolve, remove the access modifier on the property accessor.


The following example generates CS0277:

// CS0277.cs
public interface MyInterface
    int Property

public class MyClass : MyInterface   // CS0277
    public int Property
        get { return 0; }
        // Try this instead:
        //set { }
        protected set { }