After updating my NuGet packages to MVC 5, my website started to fail with the following error message:
If you see this error, it probably means that not everything is upgraded correctly inside your web project. Go have a look at 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 and carefully check if you applied all steps.
“Attempt by security transparent method ‘System.Web.Mvc.PreApplicationStartCode.Start()’ to access security critical method ‘System.Web.WebPages.Razor.PreApplicationStartCode.Start()’ failed.”
If you see this error, it probably means that not everything is upgraded correctly inside your web project. Go have a look at 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 and carefully check if you applied all steps.