Attempt by 'System.Web.Mvc.PreApplicationStartCode.Start()' to critical method 'System.Web.WebPages.Razor.PreApplicationStartCode.Start()' failed

I think the issue has been solved, but if not, use this package from Nuget:

Install-Package Microsoft.AspNet.Mvc -Version 5.0.0

I have wasted a day for this error but this single line has done the work for me


tried . . . Install-Package Microsoft.AspNet.Mvc -Version 5.0.0

and. . . Install-Package -Id Microsoft.AspNet.WebHelpers

both with no success, finally had to update all packages via nuget. . worked!!

http://www.3dbuzz.com/forum/threads/202082-ASP-net-MVC-Error-before-application-start

If you're using visual studio open the nuget packages windows and run Update-Package, this will update all your dll to the last version. If it still not work, see this page: 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