|
| 1 | +--- |
| 2 | +title: Upgrade Version 9 to 10 |
| 3 | +summary: Instructions on how to upgrade NServiceBus from version 9 to version 10. |
| 4 | +reviewed: 2025-09-03 |
| 5 | +component: Core |
| 6 | +isUpgradeGuide: true |
| 7 | +upgradeGuideCoreVersions: |
| 8 | + - 9 |
| 9 | + - 10 |
| 10 | +--- |
| 11 | + |
| 12 | +include: upgrade-major |
| 13 | + |
| 14 | +## .NET target framework |
| 15 | + |
| 16 | +The minimum version of .NET that can be used with NServiceBus 10 is .NET 10. |
| 17 | + |
| 18 | +## DataBus feature moved to separate NServiceBus.ClaimCheck package |
| 19 | + |
| 20 | +The DataBus feature has been removed from the main NServiceBus package and has been released as a separate package, called [NServiceBus.ClaimCheck](https://www.nuget.org/packages/NServiceBus.ClaimCheck/). |
| 21 | + |
| 22 | +The namespace for the DataBus feature has changed from `NServiceBus.DataBus` to `NServiceBus.ClaimCheck`. The API has also been updated to use the term ClaimCheck instead of DataBus. |
| 23 | + |
| 24 | +The table below shows the mapping from the DataBus configuration types to their ClaimCheck equivalents. |
| 25 | + |
| 26 | +| DataBus feature | NServiceBus.ClaimCheck | |
| 27 | +| --- | --- | |
| 28 | +| `EndpointConfiguration.UseDataBus` | `EndpointConfiguration.UseClaimCheck` | |
| 29 | +| `NServiceBus.FileShareDataBus` | `NServiceBus.FileShareClaimCheck` | |
| 30 | +| `NServiceBus.SystemJsonDataBusSerializer` | `NServiceBus.SystemJsonClaimCheckSerializer` | |
| 31 | +| `NServiceBus.DataBusProperty<T>` | `NServiceBus.ClaimCheckProperty<T>` | |
| 32 | + |
| 33 | +### Migrating message contracts |
| 34 | + |
| 35 | +The NServiceBus.ClaimCheck library is line-level compatible with original DataBus feature, meaning, in-flight messages that are sent using DataBus will be properly handled by endpoints that have been upgraded to use NServiceBus.ClaimCheck; this is also true in reverse. |
| 36 | + |
| 37 | +Some care should be taken when migrating message contracts from `DataBusProperty<T>` to `ClaimCheckProperty<T>`. While DataBus and NServiceBus.ClaimCheck are line-level compatible, they are not runtime compatible. An endpoint that is currently using the DataBus feature will not write properties that are `ClaimCheckProperty<T>` to the DataBus. The reverse is true of NServiceBus.ClaimCheck endpoints and `DataBusProperty<T>`. To facilitate the migration, each endpoint will need a copy of the message contract that uses the supported property type. |
| 38 | + |
| 39 | +Changing from using `DataBusProperty<T>` to specifying conventions for the claim check properties will be the easiest way to migrate whilst maintaining runtime compatibility between the new and old versions. If this is not possible, the message contracts can be versioned separately too. |
| 40 | + |
| 41 | +If message contracts are in a versioned library that has been migrated to `ClamCheckProperty<T>`, then DataBus endpoints can remain on an older version of the contracts library until they can be upgraded to NServiceBus.ClaimCheck. |
| 42 | + |
| 43 | +If message contracts are not in a versioned library, a local copy of the messages can be made to facilitate the transition. In this case it is imperative that all class names, namespaces, and property names are exactly the same to make sure the message can be properly deserialized when it is received. |
| 44 | + |
| 45 | +## Extensibility |
| 46 | + |
| 47 | +This section describes changes to advanced extensibility APIs. |
| 48 | + |
| 49 | +### ContextBag can no longer store null values |
| 50 | + |
| 51 | +As part of adding nullability annotations, the `ContextBag` class no longer allows storing `null` as a value. This also applies to all types derived from `ContextBag`, including all behavior context classes and `TransportTransaction`. |
| 52 | + |
| 53 | +### StartupDiagnosticEntry has required properties |
| 54 | + |
| 55 | +As part of adding nullability annotations, the `Data` and `Name` properties of the `StartupDiagnosticEntry` class have been marked as `required`. |
| 56 | + |
| 57 | +### ICompletableSynchronizedStorageSession and IOutboxTransaction implement IAsyncDisposable |
| 58 | + |
| 59 | +`ICompletableSynchronizedStorageSession` and `IOutboxTransaction` implement `IAsyncDisposable` to better support asynchronous operations during the disposal of both types. For more information about IAsyncDisposable visit consult the [Implement a DisposeAsync guidelines](https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync). |
0 commit comments