VOOZH about

URL: https://www.nuget.org/packages/FoundationDB.Aspire.Hosting/

⇱ NuGet Gallery | FoundationDB.Aspire.Hosting 7.4.0




👁 Image
FoundationDB.Aspire.Hosting 7.4.0

dotnet add package FoundationDB.Aspire.Hosting --version 7.4.0
 
 
NuGet\Install-Package FoundationDB.Aspire.Hosting -Version 7.4.0
 
 
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="FoundationDB.Aspire.Hosting" Version="7.4.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FoundationDB.Aspire.Hosting" Version="7.4.0" />
 
Directory.Packages.props
<PackageReference Include="FoundationDB.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 FoundationDB.Aspire.Hosting --version 7.4.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FoundationDB.Aspire.Hosting, 7.4.0"
 
 
#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 FoundationDB.Aspire.Hosting@7.4.0
 
 
#: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=FoundationDB.Aspire.Hosting&version=7.4.0
 
Install as a Cake Addin
#tool nuget:?package=FoundationDB.Aspire.Hosting&version=7.4.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed.  net11.0 net11.0 is compatible. 
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
7.4.0 63 5/1/2026
7.3.2 276 6/13/2025
7.3.1 167 5/30/2025
7.3.1-preview.2 114 5/10/2025
7.3.1-preview.1 186 4/27/2025
7.3.0-preview2 138 10/17/2024