The type '<typename>' cannot be an array element type, return type, field type, generics argument type, 'ByRef' parameter type or the type of an expression converted to 'Object' or 'ValueType'

An expression declares a variable, procedure parameter, type parameter, function return, or array to be of a restricted type.

The common language runtime (CLR) exposes certain types solely for special language support, and they should not be used as data types in your application. These types include the ArgIterator, RuntimeArgumentHandle, and TypedReference structures.

Error ID: BC31396

To correct this error

  • Do not use the restricted structure as a declared data type.

See Also

Reference

ArgIterator

RuntimeArgumentHandle

TypedReference