Could it be that you need to update version references in Views/web.config?
I get students on the CMS developer courses to fix that error using the following, but if anyone finds a better solution, please let me know!
Suppressing compiler warning CS1702
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp"
extension=".cshtml"
compilerOptions="/nowarn:1702"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
warningLevel="4">
<providerOption name="CompilerVersion" value="v4.0" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
Hi Jesse, you can use .Net framework tool ILDASM.exe to look at any assembly (dll or exe) what are the "exact" references. Open developer command prompt and type: ildasm (hit enter naturally to execute ;P). Then in the app File -> Open (and select you assembly, for example episerver.cms.aspnet.dll) and then double click the "manifest" and from that list you can see the "exact" reference version.
Another option would be to use for example third party application ILSpy to look at the assembly references.
Episerver Microsoft.AspNet.Mvc NuGet dependency is in the EPiServer.Framework.AspNet NuGet package and defined like this (but means I will work with this version range, but not I'm built with these versions):
<dependency id="Microsoft.AspNet.Mvc" version="[5.2.3, 6.0.0)" />
Hi Jesse,
The EPiServer.Framework.AspNet package, which EPiServer.CMS.AspNet depends on, lists Microsoft.AspNet.Mvc as one of its dependencies, so you could just look there.
In a project where we upgraded to latest version of System.Web.Mvc we get this varing in the Razor views
Assuming assembly reference 'System.Web.Mvc, Version=5.2.3.0 Cultu.... used by Episerver.Cms,AspNet matches identity System.Web.Mvc, Version=5.2.6.0... you may need to supply runtime policy.
We have this in web.config