Skip to main content

Cannot inherit from special class 'System.ValueType'

In This Article

CodeRush Classic shows the Cannot inherit from special class ‘System.ValueType’ code issue if a class inherits from the System.ValueType class.

#Fix

Make the current class not a descendant of System.ValueType class.

#Purpose

Highlights the class declaration statements, which would cause the Cannot inherit from special class ‘System.ValueType’ compilation error.

#Example

public class TestClass: ValueType

Fix:

public class TestClass