Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0551 

Error Message

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 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; }
   }
}

Community Additions

ADD
Show:
© 2014 Microsoft