NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet · #1133 most downloaded on NuGet
Autofac extension for enabling AOP in conjunction with Castle.
Last release 1 months ago
14 Aug 2026
Release timing varies
gaps range from 2 weeks to 3.0 years
Most releases are documented
notes for 10 of 16 stable releases
1 version withdrawn
withdrawn after publishing
127 years old
19 releases · first in 1900
Optional constructor arguments now work on class-intercepted registrations. Previously, enabling class interception on a type with an optional constru
Optional constructor arguments now work on class-intercepted registrations. Previously, enabling class interception on a type with an optional constructor argument (public MyService(IThing thing = null)) meant the argument couldn't be bound, because the generated proxy constructor doesn't carry the default values of the parameters it mirrors. The defaults are now read from the type being proxied and supplied on its behalf. Values passed to the resolve operation, values configured on the registration, and services available from the container all still take precedence, so binding behaves the same as it would without a proxy.
Note that this can change which constructor is selected on a class-intercepted type. A constructor with an optional argument that previously couldn't be bound is now bindable, so Autofac may select it where a narrower overload used to win. For example, given MyService(IThing thing) and MyService(IThing thing, int retries = 5), the two-argument constructor is now selected.
Updated Autofac reference to 9.3.2.
Retained support for net10.0, net8.0, netstandard2.1, and netstandard2.0.
One column per quarter.
Updated Autofac reference to 9.3.1.
Updated Autofac reference to 9.3.1.
Dropped support for net6.0 . This target framework has reached end of life and is no longer built. Consumers must target net8.0 or later (or one of th
net6.0. This target framework has reached end of life and is no longer built. Consumers must target net8.0 or later (or one of the supported netstandard targets).6.5.0 to 9.3.0. Projects must be compatible with Autofac 9 to upgrade.EnableClassInterceptors and EnableInterfaceInterceptors now accept an optional Func<Type, bool> shouldIntercept predicate so interception can be applied selectively based on the implementation type. This is especially useful with assembly scanning, where only some scanned types should be intercepted. For interface interception the predicate is evaluated at resolve time against the resolved implementation type; for class interception it is evaluated per type at registration. All new overloads are additive — existing signatures are unchanged, preserving binary compatibility.AsClosedTypesOf and enabling interface interception could throw because the concrete type registered alongside the interface failed the interface-only check. Interception now validates only the service actually being resolved.net10.0 and net8.0; retained support for netstandard2.1 and netstandard2.0.5.1.1 to 5.2.1.[KeyFilter] with an enum key together with class interception does not work, because Castle DynamicProxy reproduces the enum attribute argument as its underlying integer type, so the key no longer matches the registered keyed service (upstream castleproject/Core#748). Workarounds: use a string key, or use interface interception instead of class interception (#56).Added net6.0 target framework.
Added net6.0 target framework.
Update Castle.Core to v5.1.1 (thanks @sstassen-wowcorp !)
Full Changelog: v6.0.1...v7.0.0
Update the dependency on Autofac to version 6.2.0 by @Dmitrii-Naumov in #44
Full Changelog: v6.0.0...v6.0.1
The Autofac dependency has been updated to require 6.0.0 or later. There are some breaking changes in 6.0.0 - see the Autofac release notes for more i…
This release is an update for compatibility with Autofac 6.0.0. The Autofac dependency has been updated to require 6.0.0 or later. There are some breaking changes in 6.0.0 - see the Autofac release notes for more information.
PropertiesAutowired not working when EnableInterfaceInterceptors and AllowCircularDependenciesnet461 target framework - this also removes the ability to intercept transparent proxies (WCF, .NET Remoting) because those are classic .NET constructs.6.0.0This 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.
net45 or netstandard1.3net461, netstandard2.0, netstandard2.1c247e60
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.
Upgrade Castle.Core to 4.3.1 for performance improvements.
Updated the Castle.Core minimum version to 4.2.1 due to the new "slow-assembly-versioning" approach taken by Castle.Core. See the "Known Issues" secti
Updated the Castle.Core minimum version to 4.2.1 due to the new "slow-assembly-versioning" approach taken by Castle.Core. See the "Known Issues" section of the Autofac interceptors doc for additional info.
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
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →