Hi everyone,
At this point, the latest versions of all our components for NServiceBus version 7 support running on .NET 6. A few components required updates, which are described below.
What we’ve done
Here is what we have done to fully support .NET 6 with NServiceBus:
- We have run all our automated tests while targeting .NET 6 in the test projects.
- Our continuous integration process will continue to run tests on .NET 6.
- Our documentation samples now include downloads for .NET 6.
We’ve also created new releases of the following components to support .NET 6:
-
NServiceBus.Persistence.Sql 6.3.0: Fixes a bug related to conflicts between SQL scripts for outbox, timeouts, and subscriptions coming from multiple projects when using
dotnet publish
. - Updates to Azure Functions support for .NET 6 and Functions Host v4
- .NET Tool updates to support being run on .NET 6:
.NET 6 features
Here are the results of our investigations into .NET 6 and C# 10 features that may be of interest:
- Code trimming: NServiceBus relies on features that aren’t compatible with trimming, so we cannot enable trimming on NServiceBus assemblies. While it is possible to enable trimming in a project that includes NServiceBus, we don’t run automated tests in this configuration and can’t guarantee it will work, so we don’t recommend it. We may investigate this feature more in the future, but haven’t heard a lot of interest on it so far.
-
Record structs: Using a
public readonly record struct
as a message type provides a way to implement an immutable message. We have tested NServiceBus handlers with record structs and they seem to work quite well. -
Implicit global usings: In the future we will investigate whether to include the
NServiceBus
namespace when implicit usings are enabled.
If you run into any roadblocks with .NET 6, please let us know by contacting our support.
With thanks,
The team in Particular