Skip to main content

Static class cannot be abstract

In This Article

CodeRush Classic shows the Static class cannot be abstract code issue if a static class is marked as abstract.

#Fix

Remove the abstract or static modifier from the class declaration.

#Purpose

Highlights the class declarations, which would cause the An abstract class cannot be sealed or static compilation error.

#Example

public static abstract class MyClass

Fixes:

public static class MyClass
public abstract class MyClass