I am getting the following error:
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuratio
The cause of this error is the web.config in the Views folder referencing System.Web.WebPages.Razor, Version=2.0.0.0 instead of 3.0.0.0.
Typically this can happen after a nuget-package upgrade, which does not account for this folder.
Update the Views\Web.config file:
for more information on upgrading to MVC 5 http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2