Categories
Visual Studio

C# MVC broken Razor Intellisense

Today I was looking at the new feature Microsoft announced a few weeks ago that Xamarin is now in Visual Studio by default. After working with it for a few hours I had to go back and make some changes to one of our web mvc projects. At that moment I saw that I did not have anymore Razor Intellisense in Visual Studio. The first thing I tried was restarting Visual Studio, but no effect. So I opened different web project to see if Razor Intellisense was working their, but also broken. So I went online and tried to find an answer.

The first answer I found  on Stack Overflow was resetting the Visual Studio user data.

devenv.exe /resetuserdata

Running the above command line did not work because I got the following error:

'devenv.exe' is not recognized as an internal or external command, operable program or batch file.

After trying to get the command line to run with continued failure I decided to look further and find a different solution. And the solution I found which worked for me was following the steps below:

  1. Close Visual Studio
  2. Find the cache folder:  %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
  3. Delete the contents
  4. Restart Visual Studio
  5. Open a Razor file and check Intellisense.

By Bart van Duinkerken

Driven and energetic consultant and developer with 8+ years of experience working on complex projects with clients across multiple business lines. Fluent in Dutch and English; Self-taught .NET developer; Skilled at bridging the gap between business and IT. Excellent at analyzing business requirements and translating them to development needs. Love working with ambitious people not scared of thinking outside of the box. Enjoy guiding and others understanding business requirements.