NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error CS0545

'function' : cannot override because 'property' does not have an overridable get accessor

An attempt was made to define an override for a property accessor when the base class has no such definition to override. This error can be resolved by adding a virtual accessor in the base class.

The following sample generates CS0545:

namespace x
{
   public class a 
   {
      public int i
      {
         set 
         {
         }
         // uncomment this accessor to resolve CS0545
/*
         virtual get
         {
            return 0;
         }
*/
      }
   }

   public class b : a 
   {
      public override int i   // CS0545
      {
         get
         {
            return 0;
         }
      }
      public static void Main()
      {
      }
   }
}

See Also

Property Declaration | Accessors