Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0550

'accessor' adds an accessor not found in interface member 'property'

The implementation of a property in a derived class contains an accessor that was not specified in the base interface.

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

The following sample generates CS0550.

// CS0550.cs
namespace x
{
   interface ii
   {
      int i
      {
         get;
         // add the following accessor to resolve this CS0550
         // set;
      }
   }

   public class a : ii
   {
      int ii.i
      {
         get
         {
            return 0;
         }
         set {}   // CS0550  no set in interface
      }

      public static void Main() {}
   }
}

Community Additions

ADD
Show:
© 2014 Microsoft