CA1048: Do not declare virtual members in sealed types
Visual Studio 2012
|
TypeName |
DoNotDeclareVirtualMembersInSealedTypes |
|
CheckId |
CA1048 |
|
Category |
Microsoft.Design |
|
Breaking Change |
Breaking |
Types declare methods as virtual so that inheriting types can override the implementation of the virtual method. By definition, you cannot inherit from a sealed type, making a virtual method on a sealed type meaningless.
The Visual Basic .NET and C# compilers do not allow types to violate this rule.