This is part of the NServiceBus Upgrade Guide from Version 5 to 6, which also includes the following individual upgrade guides for specific components:
Feature Details
- Assembly Scanning Changes in NServiceBus Version 6
- No Async Suffix
- Dependency Injection Changes in NServiceBus Version 6
- Deprecated TransportMessage in NServiceBus Version 6
- Endpoint API changes in NServiceBus Version 6
- Extension Seam Changes in NServiceBus Version 6
- Migrate handlers and sagas to Version 6
- Header API changes in NServiceBus Version 6
- Messaging Changes in NServiceBus Version 6
- Moving away from IBus in Version 6
- Recoverability Changes in Version 6
- Serialization Changes in NServiceBus Version 6
- Subscription Changes in NServiceBus Version 6
- Transaction Configuration Changes in NServiceBus Version 6
Transports
- Azure Service Bus Transport (Legacy) Upgrade Version 6 to 7
- RabbitMQ Transport Upgrade Version 3 to 4
- SQL Server Transport Upgrade Version 2 to 3
- SQL Server Transport Upgrade - Supporting Unicode in Headers
Persistence
- Upgrade from NServiceBus Azure Version 6
- NHibernate Persistence Upgrade Version 6 to 7
- NHibernate Persistence - Resolving incorrect timeout table indexes
- RavenDB Persistence Upgrade from 3 to 4
Hosting
Other
- Moving to the DataBus AzureBlobStorage Package
- Azure Cloud Services Host Upgrade Version 6 to 7
- NServiceBus.Azure package deprecated
- Gateway Upgrade Version 1 to 2
- NServiceBus Testing Upgrade Version 5 to 6
- Callback Changes in NServiceBus Version 6
- Migrating the distributor to use sender-side distribution
- Tool and Helper Changes in NServiceBus Version 6
Upgrades from NServiceBus.Azure versions 6.2.3 and below will need to apply the saga de-duplication patch followed by the saga index patch before completing the remainder of these upgrade steps.
Changing NuGet packages and namespaces
One of the most visible changes for this persister was moving it from the NServiceBus.Azure package to the NServiceBus.Persistence.AzureStorage package. This change in packaging has reset the version number to version 1.
Upgrading to the new package requires removing the NServiceBus.Azure NuGet package from the project and adding the NServiceBus.Persistence.AzureStorage NuGet package.
Once the packages have been changed, any use of the NServiceBus.
namespace must be replaced with NServiceBus.
.
New configuration API
In versions 6 and below, the Azure Storage Persistence was configured using XML configuration sections called AzureSubscriptionStorageConfig
, AzureSagaPersisterConfig
, and AzureTimeoutPersisterConfig
. These XML configuration sections have been deprecated in favor of a more granular, code-based configuration API.
For example, the following XML:
<configSections>
<section name="AzureSubscriptionStorageConfig"
type="NServiceBus.Config.AzureSubscriptionStorageConfig, NServiceBus.Azure" />
<section name="AzureSagaPersisterConfig"
type="NServiceBus.Config.AzureSagaPersisterConfig, NServiceBus.Azure" />
<section name="AzureTimeoutPersisterConfig"
type="NServiceBus.Config.AzureTimeoutPersisterConfig, NServiceBus.Azure" />
</configSections>
<AzureSagaPersisterConfig ConnectionString="UseDevelopmentStorage=true" />
<AzureTimeoutPersisterConfig ConnectionString="UseDevelopmentStorage=true" />
<AzureSubscriptionStorageConfig ConnectionString="UseDevelopmentStorage=true" />
changes to this code configuration:
var persistence = endpointConfiguration.UsePersistence<AzureStoragePersistence>();
persistence.ConnectionString("connectionString");
The new configuration APIs are accessible through extension methods on the UsePersistence
, UsePersistence
, and UsePersistence
extension points in the endpoint configuration. See Azure Storage Persistence Code Configuration for more details on code configuration API use.
Related errors:
An error occurred creating the configuration section handler for AzureSagaPersisterConfig: Could not load file or assembly 'NServiceBus.
Azure' or one of its dependencies. The system cannot find the file specified. An error occurred creating the configuration section handler for AzureSubscriptionStorageConfig: Could not load file or assembly 'NServiceBus.
Azure' or one of its dependencies. The system cannot find the file specified. An error occurred creating the configuration section handler for AzureTimeoutPersisterConfig: Could not load file or assembly 'NServiceBus.
Azure' or one of its dependencies. The system cannot find the file specified.