Aspire.Hosting.Nats 13.4.5
Aspire.Hosting.NATS library
Provides extension methods and resource definitions for an Aspire AppHost to configure a NATS resource.
Getting started
Install the package
In your AppHost project, install the Aspire NATS Hosting library with NuGet:
dotnet add package Aspire.Hosting.Nats
Usage example
Then, in the AppHost.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);
Connection Properties
When you reference a NATS resource using WithReference, the following connection properties are made available to the consuming project:
NATS server
The NATS server resource exposes the following connection properties:
| Property Name | Description |
|---|---|
Host |
The hostname or IP address of the NATS server |
Port |
The port number the NATS server is listening on |
Username |
The username for authentication |
Password |
The password for authentication |
Uri |
The connection URI with the format nats://{Username}:{Password}@{Host}:{Port} |
Aspire exposes each property as an environment variable named [RESOURCE]_[PROPERTY]. For instance, the Uri property of a resource called nats becomes NATS_URI.
Additional documentation
Feedback & contributing
No packages depend on Aspire.Hosting.Nats.
.NET 8.0
- Aspire.Hosting (>= 13.4.5)
- NATS.Net (>= 2.7.3)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Google.Protobuf (>= 3.34.1)
- Grpc.AspNetCore (>= 2.80.0)
- Grpc.Net.ClientFactory (>= 2.80.0)
- Grpc.Tools (>= 2.80.0)
- Humanizer.Core (>= 3.0.10)
- JsonPatch.Net (>= 3.3.0)
- KubernetesClient (>= 19.0.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.27)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.8)
- Microsoft.Extensions.Hosting (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Http (>= 10.0.8)
- Microsoft.Extensions.Logging (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
- Microsoft.Extensions.Primitives (>= 10.0.8)
- ModelContextProtocol (>= 1.3.0)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.15.3)
- Polly.Core (>= 8.6.6)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.8)
- System.Text.Json (>= 10.0.8)
| Version | Downloads | Last updated |
|---|---|---|
| 13.4.6 | 2 | 06/21/2026 |
| 13.4.5 | 1 | 06/21/2026 |
| 13.4.4 | 2 | 06/19/2026 |
| 13.4.3 | 4 | 06/10/2026 |
| 13.4.2 | 4 | 06/10/2026 |
| 13.4.1 | 4 | 06/10/2026 |
| 13.4.0 | 5 | 06/02/2026 |
| 13.3.5 | 6 | 05/23/2026 |
| 13.3.4 | 7 | 05/24/2026 |
| 13.3.3 | 10 | 05/17/2026 |
| 13.3.2 | 13 | 05/16/2026 |
| 13.3.1 | 9 | 05/17/2026 |
| 13.3.0 | 11 | 05/08/2026 |
| 13.2.4 | 14 | 04/27/2026 |
| 13.2.3 | 13 | 04/24/2026 |
| 13.2.2 | 14 | 04/09/2026 |
| 13.2.1 | 14 | 04/04/2026 |
| 13.2.0 | 17 | 03/28/2026 |
| 13.1.3 | 13 | 03/24/2026 |
| 13.1.2 | 21 | 02/27/2026 |
| 13.1.1 | 22 | 02/15/2026 |
| 13.1.0 | 38 | 12/18/2025 |
| 13.0.2 | 33 | 12/10/2025 |
| 13.0.1 | 35 | 12/12/2025 |
| 13.0.0 | 30 | 12/10/2025 |
| 9.5.2 | 31 | 12/10/2025 |
| 9.5.1 | 28 | 12/12/2025 |
| 9.5.0 | 30 | 12/09/2025 |
| 9.4.2 | 29 | 12/10/2025 |
| 9.4.1 | 30 | 12/10/2025 |
| 9.4.0 | 28 | 12/12/2025 |
| 9.3.1 | 36 | 12/17/2025 |
| 9.3.0 | 22 | 12/10/2025 |
| 9.2.1 | 27 | 12/19/2025 |
| 9.2.0 | 23 | 12/20/2025 |
| 9.1.0 | 32 | 12/14/2025 |
| 9.0.0 | 26 | 12/14/2025 |
| 9.0.0-rc.1.24511.1 | 24 | 12/10/2025 |
| 8.2.2 | 28 | 12/13/2025 |
| 8.2.1 | 32 | 12/20/2025 |
| 8.2.0 | 27 | 12/13/2025 |
| 8.1.0 | 29 | 12/12/2025 |
| 8.0.2 | 30 | 12/11/2025 |
| 8.0.1 | 28 | 12/20/2025 |
| 8.0.0 | 29 | 12/11/2025 |
| 8.0.0-preview.7.24251.11 | 27 | 12/20/2025 |
| 8.0.0-preview.6.24214.1 | 23 | 12/11/2025 |
| 8.0.0-preview.5.24201.12 | 22 | 12/20/2025 |