Skip to main content

Member must declare a body because it is not marked abstract or extern

In This Article

CodeRush Classic shows the Member must declare a body because it is not marked abstract or extern code issue if a member that is not abstract or extern does not declare a body.

#Fix

Declare the member body.

#Purpose

Highlights the member declarations, which would cause the ‘Member name’ must declare a body because it is not marked abstract, extern, or partial compilation error.

#Example

public void OutputText(string text);

Fix:

public void OutputText(string text)
{
    Console.WriteLine(text);
}