Visual Studio 2015 Broken Razor Intellisense

This has been recurring for me also and seems to be connected to extension updates but I have not yet been able to blame anything specific. What I have been able to discover is a less intrusive resolution.

In my case deleting the contents of this directory allows the IDE to recover:

%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache

Edit: I just came across this one which might be handy too - Clear MEF Component Cache (Open VSIX Gallery)


I solved this problem by resetting the user data

devenv.exe /resetuserdata

and remove the ".vs" folder in my project.


WARNING: this will reset all your user settings. Essentially, it is like resetting to factory defaults. You will lose any custom keyboard shortcuts, extensions you've installed etc.


FWIW, I had this problem with VS 2015 Enterprise on two different machines. On one machine, resetting user data made the problem go away (for a while). On the other machine, I had to totally uninstall and reinstall VS, and the problem went away for a while. On both machines, the problem came back after I installed an extension (once when installing Web Essentials, once when installing Git Diff Margin).

I burned an MSDN tech support case, and the answer was... Yeah, it's a bug, MS knows about it, and they're working on it.

Not a particularly actionable answer, but an answer nonetheless...

EDIT: And on the subject of working around the problem, I've encountered the problem a few more times since I posted this "answer". Most recently, I installed an update to NuGet Package Manager, and when VS restarted it started having this problem. I ran devenv.exe /resetuserdata, but that didn't help; it was still broken. So I tried again (ran devenv.exe /resetuserdata) and, bada bing bada boom, the problem went away (for now). The moral seems to be something along the lines of "if at first you don't succeed..."