Aspire.Hosting.Nats 13.6.4

Prefix Reserved
dotnet add package Aspire.Hosting.Nats --version 13.6.4
                    
NuGet\Install-Package Aspire.Hosting.Nats -Version 13.6.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aspire.Hosting.Nats" Version="13.6.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Hosting.Nats" Version="13.6.4" />
                    
Directory.Packages.props
<PackageReference Include="Aspire.Hosting.Nats" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aspire.Hosting.Nats --version 13.6.4
                    
#r "nuget: Aspire.Hosting.Nats, 13.6.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aspire.Hosting.Nats@13.6.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aspire.Hosting.Nats&version=13.6.4
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Hosting.Nats&version=13.6.4
                    
Install as a Cake Tool

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

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.AddProject<Projects.MyService>()
                       .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

https://github.com/microsoft/aspire

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
13.6.4 1,565 10/24/2026
13.6.3 1,221 10/21/2026
13.6.2 916 10/20/2026
13.6.1 9,947 10/7/2026
13.6.0 7,702 9/29/2026
13.5.4 13,778 9/15/2026
13.5.3 16,567 8/25/2026
13.5.2 1,794 8/21/2026
13.5.1 769 8/20/2026
13.5.0 4,205 8/18/2026
13.4.6 66,669 6/19/2026
13.4.5 2,961 6/17/2026
13.4.4 2,269 6/15/2026
13.4.3 4,739 6/8/2026
13.4.2 17,447 6/3/2026
13.4.1 502 6/3/2026
13.4.0 2,608 6/1/2026
13.3.5 8,995 5/21/2026
13.3.4 2,880 5/19/2026
13.3.3 3,444 5/15/2026
Loading failed