C# "No suitable method found to override." -- but there is one

Viewed 172217

I'm having trouble overriding the method of a parent class in C#. The parent class is setup like so:

public class Base {
    public Base(Game1 game)
    {
        this.game = game;
    }

    public virtual void Draw()
    {
    }
}

...And the child class:

public class Ext : Base {
    public Ext(Game1 game) : base(game)
    {
    }

    public override void Draw(SpriteBatch batch)
    {
    }
}

I know I've successfully overridden a parent method in the past, and right now I'm probably overlooking something incredibly simple... what is it?

EDIT: That was actually a typo: in the actual script, Ext does derive from Base. The problem still persists. Thanks for the quick answers, though. :)

12 Answers

I ran into a similar situation with code that WAS working , then was not.

Turned while dragging / dropping code within a file, I moved an object into another set of braces. Took longer to figure out than I care to admit.

Bit once I move the code back into its proper place, the error resolved.

Related