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:
Running VS 2015 RTM. Neither /ResetUserData nor /SafeMode worked for me. Also had some Productivity Power Tools 2015 related complains with "errors-in-ActivityLog.xml" popup when starting VS.
So, if you have similar symptoms, here's how I fixed it on my machine:
%LOCALAPPDATA%\Microsoft\VisualStudio\
and erase14.0
folder.P.S. Actually, it took me a couple times to get my intellisense working because I disabled the PowerTools first and it broke VS again when reenabled. So, it requires a complete reinstall. Might be caused by another extension in your case.
I fixed this problem by updating my project to ASP .NET MVC version 5. But it required some futher manipulations with configuration files. Here I found the step-by-step guide:
I hope this will help.
I had the same problem in VS 2015 RTM and was able to fix it by simply loading Visual Studio in Safe Mode by:
then closing and reopening it normally.
Uninstalled and reinstalled of the following worked for me:
Microsoft.AspNet.Mvc
Microsoft.AspNet.WebPages
Microsfot.AspNet.Razor
I tried the reset userdata, deleting of temp and 14, as well as changing options settings and none of those worked. I even tried repaired and reinstalled. I am using VS 2015 Version 14.0.24720.00 Update 1
A non-invasive approach is to check your Views web.config files for the correct Versions. These Web.config files are under app/Area/AreaName/Views or the general app/Views folders. They are different than the project Web.config file.
Here is an example for the latest as of the writing of this comment:
What worked for me (VS 2015 Community) was the option suggested in this answer. Running cmd.exe as administrator, I ran the following: