The analyzer will create a compile-time error when you use an NServiceBus API that returns a
Task<T> and do not either
await the task or assign it to a variable. When that happens, you’ll see:
NSB0001: A Task returned by an NServiceBus method is not awaited or assigned to a variable.
Check out the NServiceBus Analyzer documentation for details about the analyzer’s features and limitations.
These errors can be pretty tough to track down. They often behave like a race condition between the completion of the task and the end of the message handling pipeline. The consequences can be severe: anything from unexpected behavior to outright message loss. We hope that including this analyzer in NServiceBus means you will never need to track down these errors yourself.
While these versions are in beta, we’d love to hear your feedback! If the analyzer detects a missing
await in your code, please drop us a line at firstname.lastname@example.org and let us know!
The team in Particular