The type 'System.Web.Mvc.ViewPage' is ambiguous

asp.net-mvc

Solution

I see that you have provided yourself an answer, but another solution is to update your web.config with a `<runtime>` element that redirects dependent assemblies and points to the correct one:

 <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

Note that updating your project from NuGet does the same thing for you automatically for most assemblies.

Problem

This problem occurred after upgrading ASP.NET MVC versions. The type 'System.Web.Mvc.ViewPage' is ambiguous: it could come from assembly...

Original source