Provides extension methods and resource definitions for a .NET Aspire AppHost to configure a NATS resource.
In your AppHost project, install the .NET Aspire NATS Hosting library with NuGet:
dotnet add package Aspire.Hosting.Nats
Then, in the Program.cs file of AppHost, add a NATS resource and consume the connection using the following methods:
var nats = builder.AddNats("nats");
var myService = builder.AddProject<Projects.MyService>()
.WithReference(nats);https://learn.microsoft.com/dotnet/aspire/messaging/nats-component