I have been using Visual Studio 2015 with no problems for over a year now. One of the MVC.net projects that was originally developed on VS 2010 and upgraded to VS 2015 has red error lines on all HTML helpers in view. Everything still compiles and runs fine there is just limited intellisense and tons of errors that get displayed when you open a view.
The one thing I noticed is that the HTML helpers are using a different Namespace than my other working project.
For instance if I hover over Html.BeginForm the Namespace shows WebPage.HTML. In a working project Html.BeginForm shows WebViewPage.
I have spent several hours going through all suggestions from older posts and nothing has worked yet.
Razor Views not seeing System.Web.Mvc.HtmlHelper
Why don't my Html Helpers have intellisense?
Because everything compiles and actually works I believe this problem is related to VS tooling or the /views/web.config. I have verified that the tooling is set to 14 in the .proj file and that all references are correct in the view/web.config but nothing has worked. Of course I have cleaned and rebuilt the solution more times that I can count. I have also completely installed mvc.net from nuget and reinstalled several times.
The only strange constraint in this project is that I can't upgrade it past mvc 4 because there are several other dependencies in the project that are tied to .net 4.
This is the relevant part of what my view/web.config looks like
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
This is the relevant sections from my web.config
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<system.web>
<httpRuntime maxRequestLength="1048576" executionTimeout="1500"/>
<customErrors mode="RemoteOnly"></customErrors>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
Where do I go from here?