'TypeOf...Is' requires its left operand to have a reference type, but this operand has the type '<type>'

The TypeOf...Is expression checks an object variable's run-time type compatibility. This compatibility is not defined for value types.

Error ID: BC30021

To correct this error

  • If Option Strict is Off, use the TypeName or VarType function to obtain the variable's data type information.

  • If Option Strict is On, the variable declaration determines the variable's data type.

See Also

Concepts

Comparison Operators in Visual Basic

Reference

TypeName Function (Visual Basic)

VarType Function (Visual Basic)

Option Strict Statement