I encountered the same problem, but the root cause was slightly different. This one was a little tricky to solve. The project had the correct 1.0.0.0 DLL version for System.Web.WebPages and the correct configuration in the Web.config. However, the System.Web.WebPages.Deployment and System.Web.WebPages.Razor DLLs were referencing version 2s instead of Version 1s.
My coworker's solution was magically referencing the correct versions when mine didn't initially. When I looked at the project file, the Version was to 2, but the hint path for the DLLs were to Version 1. So, when he opened the solution Version 1 was used, but on mine Version 2 was used. I guess the hint path made the difference here.
What was checked in:
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Deployment.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
After fixing it:
<Reference Include="System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />