I\'m using Visual Studio 2015 Community edition, and I\'ve created an ASP.NET MVC 5 project.
When I open a view (Index
of Home
or any other), i
I had the same problem, but the above didn't work. I also deleted all 4 files in the Component cache which didn't work. I noticed that the line below
<appSettings>
was set to false
. I changed it to true
and the red squigs were gone.
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
In my case it was the reference to System.Web.Mvc had disappeared.
There was lots of errors in the cshtml files but it would compile and run. Then I found that I had an error in the xxxcontrollers.cs file trying inherit controllers.
Seems it could compile because the dll was in bin already but it was giving errors.
I did not relish having to rebuild this project. That would be days and days.
Here's how I fixed the issue:
First, reset the Visual Studio Component Cache by closing Visual Studio and deleting this folder:
C:\Users\[Username]\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
And finally, check the web.config
files and change:
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
...
</appSettings>
to
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
...
</appSettings>