Skip to content
Discussion options

You must be logged in to vote

hi @moojek thanks, good question. they come from different packages.

AddNatsClient (NATS.Extensions.Microsoft.DependencyInjection) is the one to use for most apps. It enables ad-hoc JSON serialization and registers the basic INatsClient as well as INatsConnection. I suggest this one if you don't have AOT requirement for example.

AddNats (NATS.Client.Hosting) is the minimal-dependency, AOT-friendly option. It does not register the ad hoc JSON serializer nor INatsClient. If you are keeping your dependencies very tight and/or using AOT deployments, this one is to use. it might be less user friendly is some ways.

I'll review and update the documentation (I think we did for the 3.x series but …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by moojek
Comment options

You must be logged in to vote
1 reply
@mtmk
Comment options

mtmk Jul 8, 2026
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants