Hi everyone,
We’ve just released NServiceBus 10.2.0.
NServiceBus 10.2 gives more control over endpoint hosting and handler discovery. It is now possible to disable assembly scanning entirely and rely on explicit registration paired with source-generated lookup for handlers, sagas, and features providing a foundation for aligning with ahead-of-time compilation and trimming strategies in the future, even though full AOT and trimming compliance is not yet available. Built-in support for Microsoft.Extensions.Hosting through AddNServiceBusEndpoint also enables multi-endpoint hosting, per-tenant scenarios, and proper dependency isolation within a single host process, without requiring a separate external hosting package.
Alongside these registration and hosting changes, the release brings practical enhancements to logging, serialization, and diagnostics. Logging startup diagnostics is now available as an opt-in feature with automatic size optimization to help with troubleshooting, endpoint-scoped logging makes it easier to correlate logs outside the message pipeline, and the XML serializer gains support for DateOnly and TimeOnly types. The release also includes additional performance and reliability improvements under the hood.
Improvements/Features
Handler discovery and registration
- #7641 Convention-based handler support
- #7663 Analyzer warnings for static handler classes
- #7629 Allow pipeline behaviors to be registered using Register<TBehavior>
Hosting
- #7633 Multi-hosted endpoint lifecycle, keyed DI isolation, and slot-scoped logging
- #7668 Deprecate self-hosting APIs in favor of `AddNServiceBusEndpoint`
- #7678 Add obsolete warnings to additional public self-hosting APIs
- #7667 AddNServiceBusEndpoint throws a meaningful exception when the transport is not specified
- #7683 Introduce AddNServiceBusEndpointInstaller and deprecate old installer APIs
- #7709 Add `AddNServiceBusInstallers` for Generic Host Integration
- #7658 Consolidate Microsoft.Extensions dependencies by replacing specific packages with Microsoft.Extensions.Hosting
- #7698 Expose Endpoint Name as a read-only property on EndpointConfiguration
Diagnostics, logging, and serialization
- #7660 Add opt-in startup diagnostics logging with automatic size optimization
- #7661 Expose `RollingLoggerProviderOptions` and deprecate legacy logging APIs
- #7665 Simplify startup logging paths and retire DefaultFactory runtime logger internals
- #7659 Making sure the basic logging infrastructure is always wired up
- #7692 Add support for DateOnly/TimeOnly into xml serializer
- #7126 Add DateOnly support to XmlSerializer
Performance and reliability
- #7662 Preserve transport receive properties through message dispatch
- #7631 Replace expression tree pipeline execution with prewired invokers
- #7723 Replace MD5-based deterministic GUIDs with XxHash128
When to upgrade
You should upgrade during your next maintenance window.
Where to get it
You can install NServiceBus 10.2.0 from NuGet.
Please read our release policy for more details.
With thanks,
The team in Particular