Share via


Compiler Error CS0551

Explicit interface implementation 'implementation' is missing accessor 'accessor'

A class that explicitly implements an interface's property must implement all the accessors that the interface defines.

For more information, see Using Properties (C# Programming Guide).

Example

The following sample generates CS0551.

// CS0551.cs
// compile with: /target:library
interface ii
{
   int i
   {
      get;
      set;
   }
}

public class a : ii
{
   int ii.i { set {} }   // CS0551

   // OK
   int ii.i    
   {
      set {}
      get { return 0; }
   }
}