For the complete documentation index, see llms.txt. This section of documentation is indexed by https://docs.particular.net/nservicebus/llms.txt. Here is the markdown version of this page. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md.

Enforcement of best practices

Component:
NServiceBus
NuGet Package:
NServiceBus 10.x

By default, messaging best practices are enforced for messages defined as either commands or events.

This feature can be disabled at the endpoint level using:

var routing = endpointConfiguration.UseTransport(new TransportDefinition());
routing.DoNotEnforceBestPractices();

or at the message level using:

var options = new SendOptions();

options.DoNotEnforceBestPractices();

await context.Send(new MyEvent(), options);