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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With