ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: BaseTypeRequired attribute supports only classes and interfaces

Last modified: 11 February 2024

The BaseTypeRequired attribute requires the type parameter to be a class or an interface. Consequently, applying it to value types is likely to lead to an error. For example, the following will generate a warning: