Skip to main content

Override member cannot be marked as new

In This Article

CodeRush Classic shows the Override member cannot be marked as new code issue if an override member is marked as new.

#Fix

Remove the new keyword from the member declaration.

#Purpose

Highlights the member declarations, which would cause the A member marked as override cannot be marked as new or virtual compilation error.

#Example

public new override void ProcessText(string text)
{
    base.ProcessText(text);
}

Fix:

public override void ProcessText(string text)
{
    base.ProcessText(text);
}