Type '<typename>' cannot be used as an attribute because its container '<containername>' is not declared 'Public'

The class or module where this attribute is defined is not declared using the Public modifier. Classes and modules that do not specify an access modifier are declared as Friend by default.

Error ID: BC31517

To correct this error

  • Add the Public modifier to the class or module where this attribute is defined.

See Also

Reference

Public (Visual Basic)