'Why should Custom Validation Attributes be sealed in C#

I'm trying to create a custom C# Validation Attribute(without sealed keyword) for Data Annotation.

 public class MyValidatorAttribute : ValidationAttribute
 {
 }

But Microsoft page here says "Make the class not inheritable." why?

Do I overlooked something by allowing "MyValidatorAttribute" class as inheritable?



Solution 1:[1]

According to this code analysis rule it is for performance reasons.

When retrieving custom attributes .NET will normally search the inheritance hierarchy and this can add an overhead that may not be required.

This would not stop you creating an abstract attribute that several sealed implementations inherited from.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Richard Garside