3
votes

After installing ASP.NET MVC Fixed DisplayModes package, I get the following error when building my MVC4 website:

ASPNETCOMPILER : error ASPRUNTIME: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Users\Muhammad\AppData\Local\Temp\Temporary ASP.NET Files\temp\8b747d93\6b897626\assembly\dl3\00bbd837\ffb45330_28d7ce01\System.Web.WebPages.Razor.dll'.

I searched the project configuration and references for and mention of version 2.0 of System.Web.WebPages.Razor and removed it with no success.

1

1 Answers