Out of nowhere my ASP.NET MVC 4 solution gives me this error:
Inheritance security rules violated by type: \'System.Web.WebPages.Razor.WebPageRazorHos
Commenting out the binding redirect as suggested above worked for 3 of my older machines but did not work on a fourth, newer machine.
Turns out that commenting out the binding redirect apparently just allows System.Web.Razor version 1.0.0.0 to be found/used, but my 4th machine, a newly built machine, lacked System.Web.Razor.DLL version 1.0.0.0.
Copying System.Web.Razor version 1.0.0.0 DLL to that machine in the website's bin folder, then my problem was solved. Removing 1.0.0.0 version DLL and putting version 2.0.0.0 back, the problem returned.
Another discovery I made regarding the machines where the bindingRedirect approach did work was that once RazorEngine worked for me after having commented out the binding redirect, I could un-comment-out the binding redirect and RazorEngine continued to work.