Class '<classname>' must declare a 'Sub New' because its base class '<classname2>' does not have an accessible 'Sub New' that can be called with no arguments

A derived class does not declare a constructor, and Visual Basic cannot generate one because there is no base class constructor it can call.

When a derived class does not declare a constructor, Visual Basic attempts to generate an implicit parameterless constructor that calls MyBase.New(). If there is no accessible constructor in the base class that can be called without arguments, or if there is more than one, Visual Basic cannot generate an implicit constructor.

Error ID: BC30387

To correct this error

  1. Declare and implement at least one Sub New constructor somewhere in the derived class.

  2. Add a call to a base class constructor, MyBase.New(), as the first line of every Sub New.

See also