Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.
Razor is an ASP.NET programming syntax used to create dynamic web pages with the C# or VB.NET programming languages. Razor was in development in June 2010 and was released for Microsoft Visual Studio 2010 in January 2011. Razor is a simple-syntax view engine and was released as part of MVC 3 and the WebMatrix tool set.
I've found in this answer another way to fix it without the devenv.exe /ResetUserData
Just delete the contents of this directory with Visual Studio closed:
%LocalAppData%\Microsoft\VisualStudio\<visual_studio_version_number>\ComponentModelCache
To find the version number of the Visual Studio edition your are running please refer this list. Note that only the major number is important, the minor version can and will probably differ. In my case I had Visual Studio 2017 Enterprise installed so I looked for 15.xx
and found 15.0_9a1c4a06
inside the AppData folder.
I had the same problem, the only fix so far is by resetting all user data (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /ResetUserData
).
NOTE: You will lose all customizations, e.g. keyboard shortcuts and window layouts if you do this!
EDIT: People are saying this only works for RC, not RTM, so you might want to try the other fixes first.
I had the same problem in VS 2015 RTM and was able to fix it by simply loading Visual Studio in Safe Mode by:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /SafeMode
then closing and reopening it normally.
After Updating Visual Studio 2015 Update 1 I had same issue. I tried all the answers but did not work for me.
The fix for me was going to programs and properties > Visual Studio community edition > Change. I clicked on modify.
In the list make sure to put a check mark on "Microsoft Web Developer Tools" under "Windows and Web Development" .
It was not checked in my list howewer :/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With