I'm developing a web api as part of a MVC/API ASP.NET on VS 2013, MVC 5, API 2, but my AutofacWebApiDependencyResolver
throws an exception every time I try to register it:
Additional information: Inheritance security rules violated while overriding member: 'Autofac.Integration.WebApi.AutofacWebApiDependencyResolver.BeginScope()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
I've tried a lot of things unsuccessfully. Keep in mind I have the latest autofac.webapi.nupkg but it still not working.
You need to install a NuGet package called Autofac ASP.NET MVC5 Integration as well as Autofac ASP.NET Web API 2 Integration and of course the latest version of Autofac which currently is 3.2.0.
For some reason these packages are not first in the results but rather page 2, which is kind of a bummer.