Compiler Error CS0551
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

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 Property Declaration and Accessors.

The following sample generates CS0551:

// CS0551.cs
interface ii
{
   int i
   {
      get;
      set;
   }
}

public class a : ii
{
   int ii.i   // CS0551
   {
      set
      {
      }
      // uncomment the following accessor to resolve
      /*
      get
      {
         return 0;
      }
      */
   }

   public static void Main()
   {
   }
}
Show:
© 2016 Microsoft