Attempt by security transparent method failed

If you are seeing the following:

Attempt by security transparent method ‘Microsoft.Web.Mvc.ScriptExtensions.Script(System.Web.Mvc.HtmlHelper, System.String)’ to access security critical type ‘System.Web.Mvc.MvcHtmlString’ failed.

or something similar chances are you’ve recently updated your project from MVC 4 to 5 and didn’t update all the references in nuget to target the new version. In my case the MVC4Futures nuget package should be removed and the Microsoft.AspNet.Mvc.Futures package should be used instead.

Leave a Reply

Your email address will not be published. Required fields are marked *