A nullable type cannot be inferred for variable '<variablename>'
A nullable value type cannot be inferred from a reference type, such as an array, a class, or a String
. The value from which the data type is inferred must be a value type. The following code illustrates this error.
'' Not valid.
'Dim arrList? = New ArrayList
'Dim except? = New Exception
'Dim obj? = New Object
'Dim stringVar? = "Open the application."
' Valid.
Dim intVar? = 10
Error ID: BC36628
- Remove the nullable designation.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: