Kahuna.Aspire.Client 1.15.6

dotnet add package Kahuna.Aspire.Client --version 1.15.6
                    
NuGet\Install-Package Kahuna.Aspire.Client -Version 1.15.6
                    
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="Kahuna.Aspire.Client" Version="1.15.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kahuna.Aspire.Client" Version="1.15.6" />
                    
Directory.Packages.props
<PackageReference Include="Kahuna.Aspire.Client" />
                    
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 Kahuna.Aspire.Client --version 1.15.6
                    
#r "nuget: Kahuna.Aspire.Client, 1.15.6"
                    
#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 Kahuna.Aspire.Client@1.15.6
                    
#: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=Kahuna.Aspire.Client&version=1.15.6
                    
Install as a Cake Addin
#tool nuget:?package=Kahuna.Aspire.Client&version=1.15.6
                    
Install as a Cake Tool

Kahuna.Aspire.Client

Registers a Kahuna KahunaClient from a .NET Aspire connection string.

builder.AddKahunaClient("kahuna");

app.MapPost("/orders/{id}", async (string id, KahunaClient kahuna) =>
{
    await using KahunaLock orderLock = await kahuna.GetOrCreateLock($"order/{id}", TimeSpan.FromSeconds(10));
    // ...
});

The call registers:

  1. A singleton KahunaClient for the endpoints in ConnectionStrings:kahuna.
  2. A health check that asks each endpoint for its cluster membership, until one node can serve. With more than one endpoint, each call has a limit of 2 seconds.
  3. The export of the Kahuna.Client spans and the Kahuna.Client and Kahuna.Client.Routing metrics.

Settings bind from the Kahuna:Client configuration section:

{
  "Kahuna": {
    "Client": {
      "DisableHealthChecks": false,
      "HealthCheckTimeout": "00:00:05",
      "DisableTracing": false,
      "DisableMetrics": false
    }
  }
}

The connection string can name one node (http://localhost:8083), a comma-separated list of nodes, or use the Endpoints= key. For two clusters, call AddKeyedKahunaClient("name") once for each.

The client sends each request to the next node in turn, also when that node is down, and it does not send a failed request again. An application that must continue while a node is down needs a time limit and a retry of its own. See RetryAsync in examples/ClusterExample/ClusterExample.Api/Program.cs.

Product 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. 
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

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.15.6 71 11/7/2026
1.15.0 64 11/5/2026