c# - Getting constant error indications instead of Intellisense help in LINQ query -


i'm not new visual studio, i'm new vs2012 , linq. try build query, instead of getting useful intellisense table field names, look-ahead , errors indicated on next lines of code. let's have 2 lines of code. when try insert line in between, vs doing red underlines on new line 3, because line 2 still incomplete i'm typing out.

this simple console app i'm working on learn stuff. have "using system.linq" in file.

notice in example screenshot how "where", "foreach" underlined in red i'm typing out. when type period after c, i'm expecting list of field names pop up.

code

i'm spoiled resharper, visual studio isn't giving me same behavior, here couple of tips may help:

  1. make sure have using system.linq; statement. isn't obvious because feels where keyword , shouldn't rely on specific package, due way linq relies on extension methods, necessary.
  2. try putting semicolon after linq statement:

    var test = t in new[] {1, 2, 3} t.  ; 

    this should avoid look-ahead problems since it's more obvious foreach has nothing this.

  3. consider getting resharper.

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -