NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet
NuGet, #1138 most downloaded on NuGet
Autofac integration for ASP.NET WebAPI.
Latest stable
7.0.0
Last release 4 months ago
20 Jul 2026
Release timing varies
gaps range from 3 weeks to 3.2 years
Most releases are documented
notes for 15 of 21 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
23 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
Removed support for .NET Framework 4.7.2.
continuation parameter on AutofacActionFilterAdapter.ExecuteActionFilterAsync to next. Source code calling this method with a named argument must be updated.Packages for Autofac.WebApi are no longer published to MyGet. Instead, builds are now available from GitHub Packages This also means the actual packag
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Bump Newtonsoft.Json from 5.0.8 to 13.0.1 for security fix
AutofacWebApiDependencyScope so it doesn't stick in the finalizer queue (thanks @srogovtsev! #69)Full Changelog: https://github.com/autofac/Autofac.WebApi/compare/v6.1.0...v6.1.1
The current HttpRequestMessage is now held internally using AsyncLocal instead of direct call context access to help with Code Access Security issues
HttpRequestMessage is now held internally using AsyncLocal instead of direct call context access to help with Code Access Security issues - by @pengweiqhca in https://github.com/autofac/Autofac.WebApi/pull/65Full Changelog: https://github.com/autofac/Autofac.WebApi/compare/v6.0.1...v6.1.0
Fix #59: HttpRequestMessage is disposed after the filters are resolved
HttpRequestMessage is disposed after the filters are resolvedBreaking change: Starting with Autofac 6.0, we now only target netstandard2.0 and netstandard2.1; we have removed the explicit target for net461.
Version 6.0.0 is a compatibility release for Autofac v6.
Breaking change: Starting with Autofac 6.0, we now only target netstandard2.0 and netstandard2.1; we have removed the explicit target for net461.
The impact to you is that, while Autofac will still work on .NET Framework 4.6.1 as it did before, we strongly encourage you to upgrade to .NET Framework 4.7.2 or higher, as per the .NET Standard Documentation, to avoid any of the known dependency issues when using .NET Standard packages in .NET Framework 4.6.1.
This release is an update for compatibility with Autofac 5.0.0 and requires that new version. Autofac 5.0.0 does have some breaking changes - see the…
This release is an update for compatibility with Autofac 5.0.0 and requires that new version. Autofac 5.0.0 does have some breaking changes - see the Autofac release notes for more information.
c247e60
This is the first major-version release we've had in about three years (Autofac 4.0 was released in August 2016). There are some breaking changes and new features you should know about as you decide your upgrade strategy.
Starting with Autofac 5.0 there is no longer support for .NET 4.5.x . .NET 4.5.2, the last release in that line, follows the same support lifecycle as Windows Server 2012 R2 which ended mainstream support in September 2018 .
Autofac 5.0 now targets:
netstandard2.0
netstandard2.1
net461
The container registry can no longer be updated after it has been built.
The ContainerBuilder.Update method was marked obsolete in November 2016 and there has been a robust discussion to answer questions about how to get the container contents to adjust as needed at runtime.
ContainerBuilder.Update has now been removed entirely.
If you need to change registration behavior at runtime, there are several options available to you including the use of lambdas or child lifetime scopes. See this discussion issue for examples and ideas. We will work to add some documentation based on this issue.
[ PR #948 - thanks @weelink !]
Resolving a service from a lifetime scope will now check all parent scopes to make sure none of them have been disposed.
If you dispose a lifetime scope, all children of that lifetime scope will stop resolving objects. In cases like this you'll start getting ObjectDisposedException instead.
If you have a custom application integration that involves creating/destroying lifetime scopes (e.g., custom per-request support ) this may cause issues where proper disposal ordering is not occurring.
[ Fixes #1020 ; PR #1061 - thanks @alistairjevans !]
Autofac will no longer do property injection on static properties when auto-wiring of properties is enabled.
If your application behavior depends on static property injection you will need to do some additional work like adding a build callback to populate the property.
[ Fixes #1013 ; PR #1021 - thanks @alistairjevans !]
Autofac lifetime scopes now implement the IAsyncDisposable interface so they can be disposed asynchyronously.
await using ( var scope = container . BeginLifetimeScope ( ) ) { var service = scope . Resolve < ServiceThatImplementsIAsyncDisposable > ( ) ; // When the scope disposes, any services that implement IAsyncDisposable will be // Disposed of using DisposeAsync rather than Dispose. }
[ PR #1037 - thanks @alistairjevans !]
Autofac is now build using nullable reference type annotations . This allows developers to get sensible compiler warnings if they opt-in, thus avoiding NullReferenceException instances where possible.
[ PR #1037 - thanks @alistairjevans !]
One method of running code at container build time is by registering a build callback . Previously this only worked at the container level, but we've added the ability to register callbacks that run at lifetime scope creation as well.
var scope = container . BeginLifetimeScope ( cfg => { cfg . RegisterBuildCallback ( scope => { /* do something */ } ) ; } ) ;
The callback will be invoked just prior to BeginLifetimeScope exiting, after any startable components are instantiated.
[ Fixes #985 ; PR #1054 - thanks @alistairjevans !]
#1030 : ParameterFilterAttribute now checks to see if it can resolve a parameter before doing it. ( PR #1053 - thanks @RaymondHuy !)
#1040 : IsRegistered no longer throws an IndexOutOfRangeException when called on an open generic type. ( PR #1045 - thanks @RaymondHuy !)
#1041 : PropertiesAutowired now works with the new decorator syntax. ( PR #1043 - thanks @RaymondHuy !)
#1057 : NuGet package icon is now embedded in the package. ( PR #1054 - thanks @alistairjevans !)
Performance improvements:
Improved locking during component registration ( PR #948 - thanks @weelink !)
IsGenericTypeDefinedBy caching for generic type info ( PR #1038 - thanks @alistairjevans !)
Now that Autofac 5.0 is out, there is still a lot to do. We'll be working on these things as fast as we can:
Updating integration packages we support so they ensure compatibility with Autofac 5.
Updating the documentation to reflect the above changes.
Some of this is sitting in branches ready to go, other things need to be done now that we have this core package out there.
If your favorite integration isn't ready yet, we're doing our best. Rather than filing "When will this be ready?" issues, consider pull requests with the required updates.
Fix #45: Registration of filters on base controller classes should work again.
Fix #45: Registration of filters on base controller classes should work again.
Autofac.WebApi now includes some code from the open source ASP.NET web stack, licensed under Apache 2.0. While this should not affect consumers of the
Fixes:
Autofac.WebApi now includes some code from the open source ASP.NET web stack, licensed under Apache 2.0. While this should not affect consumers of the package from a licensing perspective, if you have forked this repo and/or are distributing your own version of Autofac.WebApi or its components, you should be aware of this update.
Minor perf improvements.
Minor perf improvements.
Updated AutofacWebApiDependencyResolver with virtual methods for extensibility.
ContainerBuilder.Update() to get the current request message into the request lifetime scope.AutofacWebApiDependencyResolver with virtual methods for extensibility.Resolved #16: OnActionExecuted happens in reverse order of filters in OnActionExecuting.
OnActionExecuted happens in reverse order of filters in OnActionExecuting.HttpConfiguration.RegisterHttpRequestMessage() extension so it can be used without a ContainerBuilder.AutofacWebApiDependencyResolver to execute a scope configuration action when creating a request lifetime scope.Fixed #20 - A custom controller type name suffix can now be provided to the RegisterApiControllers method.
Fixed #20 - A custom controller type name suffix can now be provided to the RegisterApiControllers method.
Fixed #6 and #14: The Autofac filter interfaces now use Task/async based method signatures rather than synchronous signatures. This avoids using Task.
Task/async based method signatures rather than synchronous signatures. This avoids using Task.Run or other methods to convert async to synchronous where HttpContext.Current could sometimes get lost.RegisterModelBinders as obsolete since it doesn't actually register the model binders such that they hook into dependency injection. Use the AsModelBinderForTypes() extension on binder registrations instead.AllowPartiallyTrustedCallersAttribute).Nothing published for this version
Nothing published for this version
This release occurred prior to switching Autofac components to separate repositories.
This release occurred prior to switching Autofac components to separate repositories.
InstancePerApiRequest to accept additional lifetime scope tags.RegisterHttpRequestMessage method to the container builder that uses a DelegatingHandler to make the current HttpRequestMessage resolvable in the dependency scope.IAutofacActionFilter causes each filter to execute multiple times. Filter wrappers are now only added once per ControllerType, FilterScope and MethodInfo combination.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.