The requested page is not available for the requested platform. You are viewing the content for Default platform.

Override member cannot be marked as virtual

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

Fix

Remove the virtual 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 virtual override void ProcessText(string text)
{
    base.ProcessText(text);
}

Fix:

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