Reputation: 10919
How come when do this in C#...
var x = new { Name = "aaa" };
...I can get intellisense on .Name
, but when I do this in VB.NET...
Dim x = New With {.Name = "aaa"}
...I get no intellisene on .Name
?
Upvotes: 5
Views: 669
Reputation: 98750
This sounds a momentary situation to me. Because when I try,
Dim x = New With {.Name = "aaa"}
It shows
Consider also Option Infer Statement
Enables the use of local type inference in declaring variables.
Upvotes: 6
Reputation: 10919
Answering my own question here. In VB.NET, you have to use the module level option infer on
.
I was going to just delete this question after I figured out the problem, but 1) I can't because this question already has an answer and 2) I am sure this will be helpful to others anyway.
Happy inferring.
Upvotes: 2