NServiceBus support for .NET 6 complete

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:

  1. We have run all our automated tests while targeting .NET 6 in the test projects.
  2. Our continuous integration process will continue to run tests on .NET 6.
  3. Our documentation samples now include downloads for .NET 6.

We’ve also created new releases of the following components to support .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

1 Like