---
description: "Compiler Error CS0545"
title: "Compiler Error CS0545"
ms.date: 07/20/2015
f1_keywords: 
  - "CS0545"
helpviewer_keywords: 
  - "CS0545"
ms.assetid: f8c50376-76c4-46ac-9ee1-76cc58005cea
---
# Compiler Error CS0545

'function' : cannot override because 'property' does not have an overridable get accessor  
  
 A try was made to define an override for a property accessor when the base class has no such definition to override. You can resolve this error by:  
  
- Adding a `set` accessor in the base class.  
  
- Removing the `set` accessor from the derived class.  
  
- Hiding the base class property by adding the [new](../keywords/new-modifier.md) keyword to a property in a derived class.  
  
- Making the base class property [virtual](../keywords/virtual.md).  
  
 For more information, see [Using Properties](../../programming-guide/classes-and-structs/using-properties.md).  
  
## Example  

 The following sample generates CS0545.  
  
```csharp  
// CS0545.cs  
// compile with: /target:library  
// CS0545  
public class a  
{  
   public virtual int i  
   {  
      set {}  
  
      // Uncomment the following line to resolve.  
      // get { return 0; }  
   }  
}  
  
public class b : a  
{  
   public override int i  
   {  
      get { return 0; }  
      set {}   // OK  
   }  
}  
```
