Skip to content

Bump Autofac from 5.2.0 to 6.0.0

Justas requested to merge dependabot/nuget/Autofac-6.0.0 into master

Bumps Autofac from 5.2.0 to 6.0.0.

Release notes

Sourced from Autofac's releases.

v6.0.0

Version 6.0.0 represents a major update in the Autofac internals. While every effort has been made to ensure code using version 5.x will continue to work exactly as you expect, you should be aware of the breaking changes and test things out. For the majority case, things should just continue to work; breaking changes are primarily in more rare advanced usage scenarios.

Check out the release blog post! Also, the documentation has been updated and is ready!

Starting with Autofac 6.0, we now only target netstandard20 and netstandard21; 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.

New Features

There are a lot of new features, but the big ones are here. Other features and fixes will be outlined in the Issues section, below.

Issues and PRs

The following issues have been addressed in v6:

  • #718: Circular dependency support using property injection and relationships like Lazy<T> should now work.
  • #788: DOT graph support has been added via the Autofac.Diagnostics.DotGraph package.
  • #798 / #1148: Circular dependency handling uses the .NET runtime to check stack depth when checking for circular dependencies rather than using a fixed stack depth.
  • #828: The ILifetimeScope.LifetimeScopeEnding event is raised and completes before the scope is disposed.
  • #970: The composite pattern is now supported.
  • #1069 / #1172: Core Autofac events are now async-friendly.
  • #1120 / #1128: ContainerBuilder is now sealed.
  • #1123: Explicitly injected properties can now be declared using an expression.
  • #1126 / #1169: Diagnostics are handled via DiagnosticSource.
  • #1162: A new "pooled" lifetime type has been added via the Autofac.Pooling package.

Breaking Changes

We'll do our best to keep an upgrade guide with breaking changes available and up to date. We're pretty sure we caught them all, but if you find a gotcha, let us know on the Documentation repo.

A summary of the breaking changes is as follows:

  • net461 is no longer targeted; Autofac now targets netstandard2.0 and netstandard2.1.
  • IConstructorSelector implementations need to switch to use BoundConstructor instead of ConstructorParameterBinding.
  • IRegistrationSource implementations need to update the RegistrationsFor method signature.
  • IInstanceActivator implementations no longer have an ActivateInstance method and instead have a ConfigurePipeline method.
  • RegistrationBuilder.RegistrationData no longer exposes activation handlers. The CoreEventMiddleware is the source of events now.
  • IComponentRegistration no longer exposes activation events. The CoreEventMiddleware is the source of events now.
  • IComponentRegistry no longer supplies a DecoratorsFor method to check decorators. Use IComponentRegistry.ServiceMiddlewareFor instead.
  • ContainerBuilder is now sealed.
  • The ResolveRequest constructor now takes a ServiceRegistration instead of an IComponentRegistration.
... (truncated)
Commits
  • 39696a9 Merge pull request #1205 from alistairjevans/develop
  • 6cd646c Fix #1204 - Capture instance at the point of injection, rather than using the...
  • 0aa6e7a Merge pull request #1202 from alistairjevans/develop
  • 3821f58 Fixes #1201; add OperationSucceeded flag to OperationTraceCompletedArgs.
  • 4f3be18 Issue #880: Removed skipped test, added test for new decorator syntax.
  • 46e8503 Test for #718 passes under v6.
  • d20dc41 Header fixes.
  • 4ad7121 Header fixes.
  • 38ef391 Enable StyleCop to check for source file headers.
  • db5428b Fixes for 'delegate can be simplified.'
  • Additional commits viewable in compare view

Merge request reports