FoundationDB.Aspire.Hosting
7.4.7
dotnet add package FoundationDB.Aspire.Hosting --version 7.4.7
NuGet\Install-Package FoundationDB.Aspire.Hosting -Version 7.4.7
<PackageReference Include="FoundationDB.Aspire.Hosting" Version="7.4.7" />
<PackageVersion Include="FoundationDB.Aspire.Hosting" Version="7.4.7" />
<PackageReference Include="FoundationDB.Aspire.Hosting" />
paket add FoundationDB.Aspire.Hosting --version 7.4.7
#r "nuget: FoundationDB.Aspire.Hosting, 7.4.7"
#:package FoundationDB.Aspire.Hosting@7.4.7
#addin nuget:?package=FoundationDB.Aspire.Hosting&version=7.4.7
#tool nuget:?package=FoundationDB.Aspire.Hosting&version=7.4.7
Using Aspire
It is possible to add a FoundationDB cluster resource to your Aspire application model, and pass a reference to this cluster to the projects that need it.
For local development, a local FoundationDB node will be started using the foundationdb/foundationdb Docker image, and all projects that use the cluster reference will have a temporary Cluster file pointing to the local instance.
Note: you will need to install Docker on your development machine, as explained in https://learn.microsoft.com/en-us/dotnet/aspire/get-started/add-aspire-existing-app#prerequisites
In the Program.cs of you AppHost project:
private static void Main(string[] args)
{
var builder = DistributedApplication.CreateBuilder(args);
// Define a locally hosted FoundationDB cluster
var fdb = builder
.AddFoundationDb("fdb", apiVersion: 720, root: "/Sandbox/MySuperApp", clusterVersion: "7.2.5", rollForward: FdbVersionPolicy.Exact);
// Project that needs a reference to this cluster
var backend = builder
.AddProject<Projects.AwesomeWebApiBackend>("backend")
//...
.WithReference(fdb); // register the fdb cluster connection
// ...
}
For testing/staging/production, or "non local" development, it is also possible to configure a FoundationDB connection resource that will pass the specified Cluster file to the projects that reference the cluster resource.
In the Program.cs of your AppHost project:
private static void Main(string[] args)
{
var builder = DistributedApplication.CreateBuilder(args);
// Define an external FoundationDB cluster connection
var fdb = builder
.AddFoundationDbCluster("fdb", apiVersion: 720, root: "/Sandbox/MySuperApp", clusterFile: "/SOME/PATH/TO/testing.cluster") ;
// Project that needs a reference to this cluster
var backend = builder
.AddProject<Projects.AwesomeWebApiBackend>("backend")
//...
.WithReference(fdb); // register the fdb cluster connection
// ...
}
Interactive tools in the dashboard
The local cluster resource can add commands to the Aspire dashboard that open an interactive tool in the terminal dock:
var fdb = builder
.AddFoundationDb("fdb", apiVersion: 730, root: "/Sandbox/MySuperApp")
.WithFdbCli() // "FdbCli" command: fdbcli, inside the cluster container
.WithFdbShell() // "FdbShell" command: FdbShell on the host, started in the root folder of the applications
;
WithFdbCli()runs thefdbcliof the container image, so it always matches the version of the cluster.WithFdbShell()runs the FdbShell .NET tool withdotnet tool exec, so the AppHost needs no reference to it. The first run downloads the package. The command runs the FdbShell released with this package, of the same version, so the tool and the AppHost always agree on how FdbShell finds the cluster. FdbShell loads the native client of the cluster's branch, the same one as the applications: the AppHost must reference theFoundationDB.Client.Nativepackage of that branch (<PackageReference Include="FoundationDB.Client.Native" />, with the version that central package management gives to every project). The AppHost stops at startup, with this fix in the message, when the package is missing or belongs to another major.minor version than the cluster.- In a solution that holds the source of FdbShell,
WithFdbShell<Projects.FdbShell>()runs the project instead. It needs aProjectReferencefrom the AppHost toFdbShell.csproj, pinned to the framework of the AppHost (SetTargetFramework="TargetFramework=net10.0"). It loads the native client of the AppHost'sFoundationDB.Client.Nativereference when there is one, and its own otherwise.
Each click on a command opens a new tab in the terminal dock. Type exit in fdbcli (or quit in FdbShell) before closing the tab.
Then, in the Program.cs, or where you are declaring your services with the DI, use the following extension method to add support for FoundationDB:
var builder = WebApplication.CreateBuilder(args);
// setup Aspire services...
builder.AddServiceDefaults();
//...
// hookup the FoundationDB component
builder.AddFoundationDb("fdb"); // "fdb" is the same name we used in AddFoundationDb(...) or AddFoundationDbCLuster(...) in the AppHost above.
// ...rest of the startup logic....
This will automatically register an instance of the IFdbDatabaseProvider service, automatically configured to connect the FDB local or external cluster defined in the AppHost.
| Product | Versions 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 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. net11.0 is compatible. |
-
net10.0
- Aspire.Hosting (>= 13.6.1)
- FoundationDB.Client (>= 7.4.7)
- Grpc.AspNetCore (>= 2.84.0)
- Grpc.Tools (>= 2.84.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 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.Logging.Configuration (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Newtonsoft.Json (>= 13.0.4)
- NodaTime (>= 3.3.3)
- OpenTelemetry.Api (>= 1.17.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- System.IO.Hashing (>= 10.0.15)
-
net11.0
- Aspire.Hosting (>= 13.6.1)
- FoundationDB.Client (>= 7.4.7)
- Grpc.AspNetCore (>= 2.84.0)
- Grpc.Tools (>= 2.84.0)
- Microsoft.Extensions.Configuration.Binder (>= 11.0.0)
- Microsoft.Extensions.DependencyInjection (>= 11.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 11.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Hosting (>= 11.0.0)
- Microsoft.Extensions.Http (>= 11.0.0)
- Microsoft.Extensions.Logging (>= 11.0.0)
- Microsoft.Extensions.Logging.Configuration (>= 11.0.0)
- Newtonsoft.Json (>= 13.0.4)
- NodaTime (>= 3.3.3)
- OpenTelemetry.Api (>= 1.17.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- System.IO.Hashing (>= 11.0.0)
-
net8.0
- Aspire.Hosting (>= 13.6.1)
- FoundationDB.Client (>= 7.4.7)
- Grpc.AspNetCore (>= 2.84.0)
- Grpc.Tools (>= 2.84.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 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.Logging.Configuration (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Newtonsoft.Json (>= 13.0.4)
- NodaTime (>= 3.3.3)
- OpenTelemetry.Api (>= 1.17.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- System.IO.Hashing (>= 10.0.15)
- System.IO.Pipelines (>= 10.0.15)
- System.Text.Json (>= 10.0.15)
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 |
|---|---|---|
| 7.4.7 | 63 | 11/10/2026 |
| 7.4.6 | 117 | 9/8/2026 |
| 7.4.5 | 107 | 8/29/2026 |
| 7.4.4 | 98 | 8/23/2026 |
| 7.4.3 | 97 | 8/17/2026 |
| 7.4.3-rc.3 | 85 | 8/9/2026 |
| 7.4.3-rc.2 | 91 | 8/3/2026 |
| 7.4.3-rc.1 | 83 | 7/30/2026 |
| 7.4.2 | 107 | 7/13/2026 |
| 7.4.1 | 100 | 7/5/2026 |
| 7.4.0 | 93 | 5/1/2026 |
| 7.3.2 | 305 | 6/13/2025 |
| 7.3.1 | 196 | 5/30/2025 |
| 7.3.1-preview.2 | 140 | 5/10/2025 |
| 7.3.1-preview.1 | 206 | 4/27/2025 |
| 7.3.0-preview2 | 169 | 10/17/2024 |