Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/whats-new/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ What's New
.. toctree::

releasenotes.rst
upgradingfrom8to9.rst
upgradingfrom7to8.rst
upgradingfrom6to7.rst
upgradingfrom5to6.rst
upgradingfrom3to4.rst
2 changes: 1 addition & 1 deletion docs/whats-new/releasenotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Release notes for Autofac and integration packages are all stored in the GitHub
- `Common Service Locator <https://github.com/autofac/Autofac.Extras.CommonServiceLocator/releases>`_
- `Moq <https://github.com/autofac/Autofac.Extras.Moq/releases>`_
- `FakeItEasy <https://github.com/autofac/Autofac.Extras.FakeItEasy/releases>`_
- `MvvmCross <https://github.com/autofac/Autofac.Extras.MvvmCross/releases>`_

* Multitenancy

Expand All @@ -44,3 +43,4 @@ Release notes for Autofac and integration packages are all stored in the GitHub
- `Aggregate Services <https://github.com/autofac/Autofac.Extras.AggregateService/releases>`_
- `Attribute Metadata <https://github.com/autofac/Autofac.Extras.AttributeMetadata/releases>`_
- `Dynamic Proxy / Interception <https://github.com/autofac/Autofac.Extras.DynamicProxy/releases>`_
- `Pooled Instances <https://github.com/autofac/Autofac.Pooling/releases>`_
9 changes: 9 additions & 0 deletions docs/whats-new/upgradingfrom7to8.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=================================
Upgrading from Autofac 7.x to 8.x
=================================

Very little changed for most people in the 8.x line. Beyond the target framework updates, there are two breaking changes, both narrow enough that you will probably only meet them if you write code against Autofac's internals.

- ``ResolveRequest`` became a ``readonly struct``, where it had been a class. Code that treats it as a reference type no longer compiles - comparing one to ``null`` is the usual way this shows up. It is also copied by value now, so a method taking one cannot mutate the caller's copy. This only affects code that handles ``ResolveRequest`` directly, which in practice means custom :doc:`resolve middleware <../advanced/pipelines>` or a custom ``IInstanceActivator``.

- The shim ``RequiresUnreferencedCodeAttribute`` that Autofac declares for older target frameworks changed from ``public`` to ``internal`` in 8.4.0. If you were applying that attribute in your own code and picking up Autofac's declaration of it, declare your own or reference the framework one instead.
31 changes: 31 additions & 0 deletions docs/whats-new/upgradingfrom8to9.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
=================================
Upgrading from Autofac 8.x to 9.x
=================================

There are no public API changes in this one. Everything that compiled against 8.x still compiles against 9.x - the changes are in which frameworks Autofac targets and which versions of two dependencies come with it.

Target Frameworks
=================

``net6.0`` and ``net7.0`` were dropped, and ``net10.0`` added. The target set went from ``net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0`` to ``net10.0;net8.0;netstandard2.1;netstandard2.0``.

If your application still targets ``net6.0`` or ``net7.0`` you can keep using this release, because both of those implement ``netstandard2.1`` and will resolve that asset instead. You lose nothing functionally; you are simply no longer running against a framework-specific build.

Dependencies
============

Two package references moved to their 10.x versions, and because they flow to you transitively they raise the floor for your application too:

- ``System.Diagnostics.DiagnosticSource`` from 8.0.1 to 10.0.0, on every target framework.
- ``Microsoft.Bcl.AsyncInterfaces`` from 8.0.0 to 10.0.0, on the ``netstandard2.0`` target only.

If something else in your dependency graph pins either of those to an 8.x version, that is the conflict to expect.

What You Gain
=============

The 9.x line added a fair amount that is worth knowing about once you have upgraded:

- :doc:`Native support for AnyKey and the ServiceKey attribute <../advanced/keyed-services>`, so a single registration can answer any key and a component can be told which key it was resolved under.
- :doc:`Opt-in metrics <../troubleshooting/metrics>` for resolve timing and lock contention.
- :doc:`Trimming and Native AOT annotations <../advanced/native-aot-trimming>`, which let the compiler tell you which Autofac features are safe to trim.