Visual Studio 2015 not syntax highlighting razor nor Intellisense

DLeh picture DLeh · May 18, 2015 · Viewed 58.5k times · Source

My Razor views in VS2015 RC are not showing the proper coloring for C# code. My project was working fine in VS2013, but it isn't in 2015, and it's not giving me any Intellisense on the C# code. The solution builds and the site runs fine.

I tried the following to no avail

  • disabling all Visual Studio extensions
  • deleting my .suo file
  • removing the project and re-adding it to the solution

How can I fix this?

Example:

Answer

fabriciorissetto picture fabriciorissetto · Oct 25, 2015

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.