I believe that you just need to add this to your web.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
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.
--
You received this message because you are subscribed to the Google Groups "Autofac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autofac+u...@googlegroups.com.
To post to this group, send email to aut...@googlegroups.com.
Visit this group at http://groups.google.com/group/autofac.
For more options, visit https://groups.google.com/groups/opt_out.
Great news. Thank Cecil.
With the MVC integration package the first release was just called Autofac.Mvc, and with each new release we created a new package name. There are two main reasons for changing the package name with each major release, with the same reasoning being applied to MVC and Web API.
The first is because creating a project with a previous version of MVC/Web API would require the user to get a specific version of the integration package; the last version that worked with that earlier version. With the integration package version numbers being tied to the core Autofac version (currently 3.0 series) determining exactly what version that is would be difficult, and even if you could figure it out would be a PITA. In the case of a project upgrade to a new MVC/Web API version uninstalling one package and grabbing the latest of another is easy enough and a one-time only exercise.
The second is if a bug is found in the integration for a previous version of MVC/Web API we need to be able to push out an updated package to correct the issue. If the latest package is targeting a different major release of MVC/Web API that would be difficult. It is also common for MVC to target a new version of the framework with each release making things even more confusing.
I wasn't sure if the second release of Web API would be 2.0 or if they would do the EF trick and jump straight to 5.0 to match the MVC release. It looks like they decided to jump the version number straight to 5.0 so that is what the NuGet package is called.
Hopefully that makes sense. It seems to have worked well in the past so I have kept going with that approach.
Cheers,
Alex.