How to Resolve Error "CS0533: 'derived-class member' hides inherited abstract member 'base-class member'" in C#
The Compiler Error CS0533 is an inheritance contract error. The message reads: "'Child.Method' hides inherited abstract member 'Parent.Method'".
In C#, an abstract member in a base class serves as a mandatory contract. It tells the compiler: "Any non-abstract class that inherits from me must provide an implementation for this specific method using the override keyword."
If you define a member in the child class with the same name but forget the override keyword, C# interprets this as an attempt to create a "new" method that hides the parent's definition. However, because the parent's definition was abstract (incomplete), hiding it leaves the parent's contract unfulfilled. Therefore, C# forbids hiding abstract members. You must override them.
Understanding Abstract Implementation
When a class inherits from an abstract base class:
- The Base Class has a "hole" in its logic (the abstract method).
- The Child Class creates a method that fits that hole.
- The
overridekeyword acts as the glue that links the Child's method to the Base's hole.
Without override, the compiler sees two separate things: an unfilled hole in the Base Class, and a totally unrelated method in the Child Class. Since the Child Class is concrete, it is not allowed to have unfilled holes, resulting in CS0533.
Scenario 1: Missing the override Keyword
This is the most common cause. You implemented the method correctly, but you forgot to explicitly tell the compiler that this method is intended to fulfill the abstract requirement.
Example of error
public abstract class Employee
{
// The Contract: Must implement CalculatePay
public abstract decimal CalculatePay();
}
public class FullTimeEmployee : Employee
{
// ⛔️ Error CS0533: 'FullTimeEmployee.CalculatePay()' hides inherited abstract member
// 'Employee.CalculatePay()'.
// Without 'override', this is treated as a "new" method that hides the parent.
// But you cannot hide an abstract member; you must implement it.
public decimal CalculatePay()
{
return 5000m;
}
}
Solution: Add 'override'
Simply add the keyword to link the implementation to the abstract definition.
public class FullTimeEmployee : Employee
{
// ✅ Correct: We explicitly fulfill the contract.
public override decimal CalculatePay()
{
return 5000m;
}
}
Scenario 2: Attempting to Use new on Abstract Members
In standard inheritance (with virtual methods), you can use the new keyword to "shadow" or hide a parent method. However, you cannot shadow an abstract method.
If you try to use new to tell the compiler "I meant to hide it," the compiler will still reject it because the abstract base member remains unimplemented.
Example of error
public abstract class Shape
{
public abstract void Draw();
}
public class Circle : Shape
{
// ⛔️ Error CS0533: Even with 'new', you are not allowed to hide an abstract member.
// The class 'Circle' would still be missing a valid implementation for 'Shape.Draw'.
public new void Draw()
{
Console.WriteLine("Drawing Circle");
}
}
Solution: Override is Mandatory
You must use override. If you strictly need a method that does not override the base (which is a rare and confusing design for abstract hierarchies), you must rename your method.
public class Circle : Shape
{
// ✅ Correct: Implement the abstract member
public override void Draw()
{
Console.WriteLine("Drawing Circle");
}
}
Conclusion
CS0533 enforces the rule that abstract members are obligations, not suggestions.
- Check the Base: Is the parent member
abstract? - Check the Child: Did you forget the
overridekeyword? - No Hiding: Remember that you cannot use
new(shadowing) on an abstract member. You must fill the "hole" in the logic before you can do anything else.