'MustInherit' cannot be specified for partial type '<partialtypename>' because it cannot be combined with 'NotInheritable' specified for one of its other partial types

A class is defined in multiple partial declarations, one of which specifies MustInherit and another of which specifies NotInheritable.

When you divide the definition of a class among several partial declarations, the compiler treats the class as the union of all its partial declarations. This applies not only to the members but also to the implementation, inheritance, and access level.

A class cannot be both abstract and sealed, meaning it cannot both require and forbid inheritance. Therefore you cannot specify both MustInherit and NotInheritable for the same class.

Error ID: BC30926

To correct this error

  • Decide whether the class should require inheritance, forbid inheritance, or neither, and remove the keywords that are inappropriate to your decision.

See Also

Concepts

Inheritance Basics

Reference

Partial (Visual Basic)

MustInherit

NotInheritable