Couchbase.Aspire.Hosting 1.0.0-alpha.4

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

Couchbase.Aspire.Hosting library

Provides extension methods and resource definitions for an Aspire AppHost to configure a Couchbase cluster resource.

Getting Started

Install the package

dotnet add package Couchbase.Aspire.Hosting

Usage example

In the AppHost.cs file of your AppHost, add a Couchbase cluster resource with the data, query, and index services and consume the connection using the following methods:

var couchbase = builder.AddCouchbase("couchbase");
var bucket = couchbase.AddBucket("mybucket");

var myService = builder.AddProject<Projects.MyService>()
    .WithReference(bucket)
    .WaitFor(bucket);

Multi-dimensional scaling example

It is also possible to run a multiple server cluster with various services assigned to different server groups:

var couchbase = builder.AddCouchbase("couchbase");
var bucket1 = couchbase.AddBucket("bucket1");

var group1 = couchbase.AddServerGroup("couchbase-group1")
    .WithServices(CouchbaseServices.Data)
    .WithReplicas(2);

var group2 = couchbase.AddServerGroup("couchbase-group2")
    .WithServices(CouchbaseServices.Index | CouchbaseServices.Query)
    .WithReplicas(2);

var myService = builder.AddProject<Projects.MyService>()
    .WithReference(bucket)
    .WaitFor(bucket);

Connection properties

When you reference a Couchbase cluster resource using WithReference, the following connection properties are made available to the consuming project:

Couchbase cluster

The Couchbase cluster resource exposes the following connection properties:

Property Name Description
Username The username for authentication
Password The password for authentication
Uri The connection URI, with the format couchbase://{Host}:{Port},{Host2}:{Port} or couchbases://{Host}:{Port},{Host2}:{Port}

The ConnectionString property is also available, which exposes all properties as a single string in the format couchbase://{Username}:{Password}@{Host}:{Port},{Host2}:{Port}.

Couchbase bucket

The Couchbase bucket resource exposes the following connection properties:

Property Name Description
Username The username for authentication
Password The password for authentication
Uri The connection URI, with the format couchbase://{Host}:{Port},{Host2}:{Port} or couchbases://{Host}:{Port},{Host2}:{Port}
BucketName The name of the bucket

The ConnectionString property is also available, which exposes all properties as a single string in the format couchbase://{Username}:{Password}@{Host}:{Port},{Host2}:{Port}/{BucketName}.

Feedback & contributing

https://github.com/couchbaselabs/couchbase-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 (1)

Showing the top 1 NuGet packages that depend on Couchbase.Aspire.Hosting:

Package Downloads
Couchbase.Aspire.Hosting.Indices

Couchbase Index Manager support for Aspire.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.4 44 1/25/2026
1.0.0-alpha.3 50 1/19/2026
1.0.0-alpha.2 46 1/17/2026
1.0.0-alpha.1 46 1/16/2026