Skip to content

Releases: autofac/Autofac

v8.3.0

07 May 18:29
Compare
Choose a tag to compare

What's Changed

  • Corrected nullable markup on IIndex<K,V>.TryGetValue() since it may return null on failure.
  • Composite services can now be keyed (#1458 - thanks @syko9000!)
  • Packages for core Autofac are no longer published to MyGet. Instead, builds are now available from GitHub Packages This also means the actual packages themselves won't be manually attached to the release - you can get them from the package source now.

Full Changelog: v8.2.1...v8.3.0

v8.2.1

03 Apr 14:50
Compare
Choose a tag to compare

Fix #1450: AutoActivate() no longer hides the default service registration. (Thanks, @nblumhardt!)

v8.2.0

17 Dec 19:29
Compare
Choose a tag to compare

What's Changed

  • Fix #1437: Improve type cache handling for generic type arguments with respect to AssemblyLoadContext disposal (#1438 - thanks @hemirunner426!)
  • Added overloads for RegisterServiceMiddleware to assist with interceptors/decorators (#1439 - thanks @idiotsky!)

Full Changelog: v8.1.1...v8.2.0

v8.1.1

09 Oct 16:26
Compare
Choose a tag to compare

What's Changed

  • Fix boxing in ResolveRequest.operator==() (#1430, thanks @SergeiPavlov!)
  • Remove redundant null-checking in resolution extensions (#1428, thanks @SergeiPavlov!)
  • Fix #1427: Ensure WithProperty registration methods consistently allow null values (#1428)

Full Changelog: v8.1.0...v8.1.1

v8.1.0

02 Sep 03:10
Compare
Choose a tag to compare

What's Changed

  • Optimized required member caching (#1415 - thanks @SergeiPavlov!)
  • Correctly handle polyfilled required infrastructure attributes by (#1421 - thanks @DoctorVanGogh!)
  • Improve memory management in registered services tracking (#1423 - thanks @snaumenko-st!)
  • Fix #1330: Generic decorators attached to generics that expose multiple service types should be handled properly (#1424)

Full Changelog: v8.0.0...v8.1.0

v8.0.0

16 Jan 18:19
Compare
Choose a tag to compare

Breaking Changes

  • Removed netcoreapp3.1 support/testing (#1401).
  • Converted ResolveRequest into a readonly struct (#1397 - thanks @SergeiPavlov!).

Additional Changes

  • Added net8.0 target (#1401).
  • Replaced use of Moq in tests with NSubstitute (#1390 - thanks @aydjay!).

Full Changelog: v7.1.0...v8.0.0

v7.1.0

11 Aug 14:17
Compare
Choose a tag to compare

What's Changed

  • Fix #1388: Re-enabled RegsiterTypes filtering. This was an accidental behavior regression where the RegisterTypes method wouldn't filter out non-registerable types.
  • RegisterType<T> and RegisterType(Type t) will now throw when non-registerable types are provided, for example containerBuilder.RegisterType<IInterface>() (you can't register interfaces - you can register things As<IInterface>). This used to throw at container build time; now it throws at RegisterType time and it has a more precise error message so you can handle these issues more proactively.

Full Changelog: v7.0.1...v7.1.0

v7.0.1

18 Apr 13:55
Compare
Choose a tag to compare

What's Changed

  • Reduced lock contention in LifetimeScope.CreateSharedInstance (thanks @botinko)
  • Optimized Autofac.Features.OpenGenerics.OpenGenericServiceBinder.TryBindOpenGenericTypedService (thanks @SergeiPavlov)

Full Changelog: v7.0.0...v7.0.1

v7.0.0

07 Mar 07:22
1910177
Compare
Choose a tag to compare

Version 7.0.0 is a major increment due to some changes in the target frameworks and some behavioral changes. We summarize these in the documentation, but included here as well:

New Features

  • Properties marked required will now be injected by default. As part of this, the default property injector using PropertiesAutowired() will not inject properties marked required. The documentation has more explanation with examples.
  • Ability to isolate AssemblyLoadContext by lifetime scope. A new method, BeginLoadContextLifetimeScope, has been added that allows you to create a lifetime scope tied to a specific AssemblyLoadContext. When the scope is disposed, Autofac will perform a best-effort release of all references to types from that context so the assemblies can be unloaded. The documentation explains this in greater detail.
  • Documentation links in exception messages. Common Autofac exceptions now include links to our online documentation to help you understand what the exceptions mean and how to troubleshoot them.

Issues and PRs

Full Changelog: v6.5.0...v7.0.0

Breaking Changes

  • net50 no longer targeted. Autofac will still work with .NET 5 via the netstandard2.1 target, but we recommend you upgrade to a later, supported version of .NET.
  • Properties marked required will now be injected by default. As noted above, required properties will be injected. This is a behavioral change from Autofac 6.0.
  • Default property injection ignores required properties. Using PropertiesAutowired() will ignore required properties because it's assumed they must be set during construction rather than post-object-creation.
  • RegisterGeneratedFactory is obsolete. This feature has been replaced by the Func<X, Y, B> built-in relationship and delegate factories.
  • ILifetimeScope has a new BeginLoadContextLifetimeScope method. If you have mocks of ILifetimeScope this method must now be implemented.

v6.5.0

16 Nov 19:35
Compare
Choose a tag to compare
  • Reflection caches have moved to a central location Autofac.Core.ReflectionCacheSet (#1341). This is part of an effort to support unloading AssemblyLoadContexts associated with child scopes and enable better plugin support (#1324).
  • IDecoratorContext now extends IComponentContext so decorator decisions can be made based on the constructed container (#1338, #1352).
  • Fix memory leak regression (#1353 - Thanks @botinko!)

Full Changelog: v6.4.0...v6.5.0