Aspire.Hosting.Nats
17.0.0
Prefix Reserved
dotnet add package Aspire.Hosting.Nats --version 17.0.0
NuGet\Install-Package Aspire.Hosting.Nats -Version 17.0.0
<PackageReference Include="Aspire.Hosting.Nats" Version="17.0.0" />
<PackageVersion Include="Aspire.Hosting.Nats" Version="17.0.0" />
<PackageReference Include="Aspire.Hosting.Nats" />
paket add Aspire.Hosting.Nats --version 17.0.0
#r "nuget: Aspire.Hosting.Nats, 17.0.0"
#:package Aspire.Hosting.Nats@17.0.0
#addin nuget:?package=Aspire.Hosting.Nats&version=17.0.0
#tool nuget:?package=Aspire.Hosting.Nats&version=17.0.0
NATS hosting integration
Use this integration to model, configure, and orchestrate a NATS resource in an Aspire solution.
Getting started
Add the integration
From your AppHost directory, add the Aspire.Hosting.Nats integration with the Aspire CLI:
aspire add Aspire.Hosting.Nats
aspire add Aspire.Hosting.Dotnet
Usage example
In the AppHost, add a NATS resource and reference it from another resource with either C# or TypeScript:
C#
var nats = builder.AddNats("nats");
var myService = builder.AddDotnetProject("myservice", "../MyService/MyService.csproj")
.WithReference(nats);
TypeScript
const nats = await builder.addNats("nats");
const myService = await builder.addNodeApp("myService", "../my-service", "server.js")
.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
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aspire.Hosting (>= 17.0.0)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Google.Protobuf (>= 3.36.1)
- Grpc.AspNetCore (>= 2.83.0)
- Grpc.Net.ClientFactory (>= 2.83.0)
- Grpc.Tools (>= 2.83.0)
- Hex1b (>= 0.173.0)
- KubernetesClient (>= 19.0.2)
- MessagePack (>= 2.5.307)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.15)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.15)
- Microsoft.Extensions.Hosting (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.Extensions.Primitives (>= 10.0.15)
- ModelContextProtocol (>= 1.4.1)
- NATS.Net (>= 2.8.2)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.18.0)
- OpenTelemetry.Extensions.Hosting (>= 1.18.0)
- Polly.Core (>= 8.7.0)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.15)
- YamlDotNet (>= 18.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Aspire.Hosting.Nats:
| Repository | Stars |
|---|---|
|
formcms/formcms
AI Agent: Open-source headless CMS built with ASP.NET Core (C#) and React, featuring REST APIs, GraphQL, and a GrapesJS page designer.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 17.0.0 | 1,830 | 11/18/2026 |
| 13.6.5 | 13,523 | 11/10/2026 |
| 13.6.4 | 14,568 | 10/24/2026 |
| 13.6.3 | 6,595 | 10/21/2026 |
| 13.6.2 | 1,269 | 10/20/2026 |
| 13.6.1 | 15,369 | 10/7/2026 |
| 13.6.0 | 8,834 | 9/29/2026 |
| 13.5.4 | 17,924 | 9/15/2026 |
| 13.5.3 | 19,254 | 8/25/2026 |
| 13.5.2 | 1,950 | 8/21/2026 |
| 13.5.1 | 789 | 8/20/2026 |
| 13.5.0 | 4,964 | 8/18/2026 |
| 13.4.6 | 70,954 | 6/19/2026 |
| 13.4.5 | 2,994 | 6/17/2026 |
| 13.4.4 | 2,279 | 6/15/2026 |
| 13.4.3 | 4,765 | 6/8/2026 |
| 13.4.2 | 19,428 | 6/3/2026 |
| 13.4.1 | 510 | 6/3/2026 |
| 13.4.0 | 2,629 | 6/1/2026 |
| 13.3.5 | 9,123 | 5/21/2026 |