62

I've updated all of the nuget packages in my project, as well as the AutoFac MVC5 Integration package (removed MVC4 one) and still no dice.

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.

p.campbell
  • 98,673
  • 67
  • 256
  • 322
Shane
  • 4,185
  • 8
  • 47
  • 64

1 Answers1

99

The package you need can be found by searching for "autofac webapi2" on Nuget.
It is called Autofac ASP.NET WebApi 2 Integration.

Kyle Trauberman
  • 25,414
  • 13
  • 85
  • 121
Alex Meyer-Gleaves
  • 3,821
  • 21
  • 11
  • 2
    I see that they are now released. Thanks, they're working great. However, even if you search for "Autofac WebAPI2", that package does not even show up on the first page. But the package för WebAPI (1) does. Not sure if there's anything you can do about that though. – MEMark Oct 28 '13 at 13:46
  • 6
    if you search nuget for "autofac webapi2" (quotes not needed) ... the package is #2 in the results ... and it fixes the error in the question. – Martin Dec 05 '13 at 14:11
  • Sure, but do you usually include version numbers of all components when searching? At least I don't, which caused me to run in to this again today, two years later. – MEMark Dec 22 '15 at 10:28
  • 1
    @MEMark it's not the Autofac library itself being versioned in the name; it's indicating that this is the Autofac library which integrates with WebApi2. It's own version will increase (now at 3.x I believe) but it will always be the library for WebApi2 integration. – JRoughan Jan 11 '16 at 03:06
  • 1
    Autofac.WebApi2 is [here](https://www.nuget.org/packages/Autofac.WebApi2/) – Ratul Sep 22 '16 at 20:45