Member '<membername>' cannot be initialized in an object initializer expression because it is not a field or property

An object initializer list cannot include shared members, constants, or method calls. The members in the initializer list must be fields or properties, and property members cannot require arguments.

Error ID: BC30990

To correct this error

  • Remove from the object initializer list all shared members, constants, method calls, or properties that have parameters.

See Also

Concepts

Object Initializers: Named and Anonymous Types

Shared Members in Visual Basic

Properties and Property Procedures

Default Properties

Object Members

Reference

Const Statement (Visual Basic)