Common Issues & Solution
How to upgrade from old version of MVC
Remove System.Web.MVC from Solution
Change the .NET Framework version to 4.6
Install MVC 5.11
Install-Package Microsoft.AspNet.Mvc -Version 5.1.1
Modify Razor Version
I am using VS2013, MVC 5.2.2.0, Web Api 2. I have just changed the all versions from 2.0.0.0 to3.0.0.0 of the following section of Web.config resides inside the View folder of my project.
<configSections> <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> </sectionGroup>
- Conflicting versions of ASP.NET Web Pages detected: specified version is "1.0.0.0", but the version in bin is "3.0.0.0".
// web.config
<configuration>
<appSettings>
<add key="webpages:Version" value="3.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
...
</configuration>