FoundationDB.Aspire.Hosting
7.3.2
dotnet add package FoundationDB.Aspire.Hosting --version 7.3.2
NuGet\Install-Package FoundationDB.Aspire.Hosting -Version 7.3.2
<PackageReference Include="FoundationDB.Aspire.Hosting" Version="7.3.2" />
<PackageVersion Include="FoundationDB.Aspire.Hosting" Version="7.3.2" />
<PackageReference Include="FoundationDB.Aspire.Hosting" />
paket add FoundationDB.Aspire.Hosting --version 7.3.2
#r "nuget: FoundationDB.Aspire.Hosting, 7.3.2"
#:package FoundationDB.Aspire.Hosting@7.3.2
#addin nuget:?package=FoundationDB.Aspire.Hosting&version=7.3.2
#tool nuget:?package=FoundationDB.Aspire.Hosting&version=7.3.2
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
// ...
}
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 is compatible. 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. |
-
net10.0
- Aspire.Hosting (>= 9.3.0)
- FoundationDB.Client (>= 7.3.2)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.Hosting (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.5.25277.114)
- Microsoft.Extensions.Options (>= 10.0.0-preview.5.25277.114)
- Newtonsoft.Json (>= 13.0.3)
- NodaTime (>= 3.2.2)
- OpenTelemetry.Api (>= 1.12.0)
-
net8.0
- Aspire.Hosting (>= 9.3.0)
- FoundationDB.Client (>= 7.3.2)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.6)
- Microsoft.Extensions.DependencyInjection (>= 9.0.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.6)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Hosting (>= 9.0.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Logging (>= 9.0.6)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.6)
- Microsoft.Extensions.Options (>= 9.0.6)
- Newtonsoft.Json (>= 13.0.3)
- NodaTime (>= 3.2.2)
- OpenTelemetry.Api (>= 1.12.0)
- System.IO.Pipelines (>= 9.0.6)
- System.Text.Json (>= 9.0.6)
-
net9.0
- Aspire.Hosting (>= 9.3.0)
- FoundationDB.Client (>= 7.3.2)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.6)
- Microsoft.Extensions.DependencyInjection (>= 9.0.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.6)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Hosting (>= 9.0.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Logging (>= 9.0.6)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Logging.Configuration (>= 9.0.6)
- Microsoft.Extensions.Options (>= 9.0.6)
- Newtonsoft.Json (>= 13.0.3)
- NodaTime (>= 3.2.2)
- OpenTelemetry.Api (>= 1.12.0)
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.3.2 | 169 | 6/13/2025 |
7.3.1 | 92 | 5/30/2025 |
7.3.1-preview.2 | 52 | 5/10/2025 |
7.3.1-preview.1 | 111 | 4/27/2025 |
7.3.0-preview2 | 68 | 10/17/2024 |