This is part of the NServiceBus Upgrade Guide from Version 7 to 8, which also includes the following individual upgrade guides for specific components:
Feature Details
- Upgrading the data bus from version 7 to 8
- Dependency Injection changes
- Upgrade NServiceBus downstreams from Version 7 to 8
- Upgrading message contracts from Version 7 to 8
- Upgrade NServiceBus pipeline extensions from Version 7 to 8
- Transport configuration changes
Transports
- AmazonSQS Transport Upgrade Version 5 to 6
- Azure Service Bus Transport Upgrade Version 2 to 3
- Azure Storage Queues Transport Upgrade Version 10 to 11
- MSMQ Transport Upgrade Version 1 to 2
- MSMQ Transport Upgrade Version 2 to 2.0.4
- RabbitMQ Transport Upgrade Version 7 to 8
- SQL Server Transport Upgrade Version 6 to 7
Persistence
- Cosmos DB Persistence Upgrade from 1 to 2
- NHibernate Persistence Upgrade Version 8 to 9
- RavenDB Persistence Upgrade from 7 to 8
- SQL Persistence Upgrade Version 6 to 7
Hosting
Other
NServiceBus version 8 does not support .NET Standard as a target framework. Therefore, message contract assemblies that target netstandard2.
and reference NServiceBus must be updated. This guide shows possible approaches. General guidance is available in the sharing message contracts documentation.
When using unobtrusive mode, the contracts assembly doesn't require a reference to NServiceBus and therefore is not affected. Unobtrusive message contracts can continue to target .NET Standard.
Change to specific target Framework
If all endpoints share the same target framework (e.g., .NET Core 3.1), the message contracts assembly can be changed from targeting .NET Standard to the same target framework as the endpoint projects.
Multi-targeting
If endpoints sharing a common contracts assembly target different platforms and frameworks (e.g. both .NET Framework 4.8 and .NET Core 6.0), the target assembly can use multi-targeting by replacing the TargetFramwork
element with the TargetFrameworks
(note the plural) element in the .
settings:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Typically, it is sufficient to list the lowest version needed -->
<TargetFrameworks>net48;net6.0</TargetFrameworks>
</PropertyGroup>
</Project>
Get help
For further information and assistance, refer to the support channels.