AI agents: use the documentation index at llms.txt to locate machine-readable pages. This section is indexed by https://docs.particular.net/nservicebus/llms.txt. The markdown version of this page is served as plain text. An MCP server at /mcp serves the same content via the search_docs and read_doc tools; it is read-only and needs no credentials. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md. They are served as text/plain because some retrieval backends reject text/markdown.

Upgrading from community System.Text.Json serializer

Message serialization with System.Text.Json is bundled into NServiceBus version 8.1 and above.

Conversion from community package

First, upgrade to NServiceBus 8.1.0 or newer.

Then, instead of:

var serialization = endpointConfiguration.UseSerialization<NServiceBus.Json.SystemJsonSerializer>();

Remove the reference to the NServiceBus.Json NuGet package and use:

var serialization = endpointConfiguration.UseSerialization<NServiceBus.SystemJsonSerializer>();

If full namespaces are not used, this code change may not be necessary, and instead, the using NServiceBus.Json; statement can be removed.

API differences

Specifying content type

The ContentTypeKey(...) method has been renamed to ContentType(...).

Options

The low level .ReaderOptions(...) and WriterOptions(...) is no longer available and it's recommended to use the JsonSerializerOptions to control serialization and deserialization behavior.

Related Articles

  • Serialization
    .NET messaging systems require serialization and deserialization of objects sent/received over transports. NServiceBus achieves this using serializers.