Visual studio is syntax checking my C# as Visual Basic

373 Views Asked by At

I've been testing some c# code in visual studio and when I opened visual studio this morning my project was full of red lines.

  • Demanding class declarations to be closed with End class
  • Red lines under semicolons
  • Variable declaration without an AS clause
  • Ctrl+K, CTRL+C Gives visual basic comments E.g. 'green text
  • //C# comments get red squiggly lines under them.

These are clearly visual basic errors which means for some reason it's trying to make my C# into VB.

I've been trying to find out what on earth to search for but no luck so far.

When I build the project there is no problem. Just the syntax errors in visual studio with red squiggly lines.

1

There are 1 best solutions below

2
Francois Borgies On

Have you try to :

  • close VS
  • delete .SUO file
  • restart VS

The SUO file is a hidden file,, which is placed in the same folder as the SLN file. It contains a lot of information such as which files are currently open in the IDE, some local settings, etc.

More Information about that.