Fixed System.MethodAccessException: Attempt by security transparent method ‘WebApplication1.WebApiApplication.Application_Start()’ to access security critical method ‘System.Web.Mvc.AreaRegistration.RegisterAllAreas()’ failed

By | November 24, 2019

Exception Details: System.MethodAccessException: Attempt by security transparent method ‘WebApplication1.WebApiApplication.Application_Start()’ to access security critical method ‘System.Web.Mvc.AreaRegistration.RegisterAllAreas()’ failed.

Resolution : Add <trust level=”Full”/> under <system.web> in web.config

<system.web>
<trust level=”Full”/>

</system.web>

[Read more about ASP.NET Trust Level]

Leave a Reply

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