问题
I've got an ASP.NET MVC application using Autofac.
I've added the appropriate packages via:
Install-Package Autofac
Install-Package Autofac.Mvc4
When I ran the web application, this error was throw:
Inheritance security rules violated while overriding member: 'Autofac.Integration.Mvc.AutofacDependencyResolver.GetService(System.Type)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
How can this be solved?
回答1:
I had installed Autofac for MVC 4 when the project type was actually MVC 5.
To solve this, I ran Uninstall-Package Autofac.Mvc4
and
Install-Package Autofac.Mvc5
来源:https://stackoverflow.com/questions/22696246/solving-autofac-issue-inheritance-security-rules-violated-while-overriding-membe