CommunityToolkit.Aspire.SeaweedFS.Client
13.4.1-beta.685
Prefix Reserved
dotnet add package CommunityToolkit.Aspire.SeaweedFS.Client --version 13.4.1-beta.685
NuGet\Install-Package CommunityToolkit.Aspire.SeaweedFS.Client -Version 13.4.1-beta.685
<PackageReference Include="CommunityToolkit.Aspire.SeaweedFS.Client" Version="13.4.1-beta.685" />
<PackageVersion Include="CommunityToolkit.Aspire.SeaweedFS.Client" Version="13.4.1-beta.685" />
<PackageReference Include="CommunityToolkit.Aspire.SeaweedFS.Client" />
paket add CommunityToolkit.Aspire.SeaweedFS.Client --version 13.4.1-beta.685
#r "nuget: CommunityToolkit.Aspire.SeaweedFS.Client, 13.4.1-beta.685"
#:package CommunityToolkit.Aspire.SeaweedFS.Client@13.4.1-beta.685
#addin nuget:?package=CommunityToolkit.Aspire.SeaweedFS.Client&version=13.4.1-beta.685&prerelease
#tool nuget:?package=CommunityToolkit.Aspire.SeaweedFS.Client&version=13.4.1-beta.685&prerelease
CommunityToolkit.Aspire.SeaweedFS.Client library
Provides an Aspire client integration for SeaweedFS. It supports both the S3-compatible API using the standard AWSSDK.S3 client, and the Native Filer API through a strongly-typed HttpClient.
Usage example
In the Program.cs file of your project, you can register the SeaweedFS clients depending on the APIs you enabled in your AppHost.
Registering the S3 Client
Call the AddSeaweedFSS3Client extension method to register an IAmazonS3 client for use via the dependency injection container.
builder.AddSeaweedFSS3Client("seaweedfs");
Registering the Native Filer Client
Call the AddSeaweedFSFilerClient extension method to register a SeaweedFSFilerClient (which wraps a configured HttpClient pointing directly to the Filer node).
builder.AddSeaweedFSFilerClient("seaweedfs");
Configuration
The Aspire SeaweedFS Client integration provides multiple options to configure the server connection based on the requirements and conventions of your project.
Use a connection string
When using a connection string from the ConnectionStrings configuration section, you can provide the name of the connection string when calling the builder methods. The connection string dynamically handles multiple endpoints (Master, S3, Filer) injected by the AppHost.
{
"ConnectionStrings": {
"seaweedfs": "Endpoint=http://localhost:8333;FilerEndpoint=http://localhost:8888;AccessKey=admin;SecretKey=admin-secret;UseSsl=false"
}
}
Use configuration providers
The client supports Microsoft.Extensions.Configuration. It loads the SeaweedFSClientSettings from configuration by using the Aspire:SeaweedFS:Client key.
Example appsettings.json that configures both endpoints and enables SSL:
{
"Aspire": {
"SeaweedFS": {
"Client": {
"Endpoint": "http://localhost:8333",
"FilerEndpoint": "http://localhost:8888",
"AccessKey": "admin",
"SecretKey": "admin-secret",
"ForcePathStyle": true,
"UseSsl": false,
"DisableHealthChecks": false
}
}
}
}
Note:
ForcePathStyledefaults totrueas it is strictly required by the SeaweedFS architecture to correctly route S3 bucket requests.
Use inline delegates
You can also pass the Action<SeaweedFSClientSettings> configureSettings delegate to set up some or all the options inline. This is particularly useful for applying advanced S3 configurations:
builder.AddSeaweedFSS3Client("seaweedfs", configureSettings: settings =>
{
settings.AccessKey = "admin";
settings.SecretKey = "admin-secret";
settings.ConfigureS3Config = s3Config =>
{
s3Config.Timeout = TimeSpan.FromSeconds(30);
s3Config.MaxErrorRetry = 3;
};
});
Consuming the Clients
Once registered, you can inject the clients into your services.
Using the S3 API:
using Amazon.S3;
using Amazon.S3.Model;
public class StorageService(IAmazonS3 s3Client)
{
public async Task CreateBucketAsync(string bucketName)
{
await s3Client.PutBucketAsync(new PutBucketRequest { BucketName = bucketName });
}
}
Using the Native Filer API:
using CommunityToolkit.Aspire.SeaweedFS.Client;
public class NativeFileService(SeaweedFSFilerClient filerClient)
{
public async Task<string> ListFilesAsync()
{
// Requires Accept header for JSON responses from Filer
var request = new HttpRequestMessage(HttpMethod.Get, "/");
request.Headers.Add("Accept", "application/json");
var response = await filerClient.HttpClient.SendAsync(request);
return await response.Content.ReadAsStringAsync();
}
}
Feedback & contributing
| 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
- AWSSDK.S3 (>= 4.0.100.2)
- CommunityToolkit.Aspire.Hosting.SeaweedFS (>= 13.4.1-beta.685)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
-
net8.0
- AWSSDK.S3 (>= 4.0.100.2)
- CommunityToolkit.Aspire.Hosting.SeaweedFS (>= 13.4.1-beta.685)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
-
net9.0
- AWSSDK.S3 (>= 4.0.100.2)
- CommunityToolkit.Aspire.Hosting.SeaweedFS (>= 13.4.1-beta.685)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
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 |
|---|---|---|
| 13.4.1-beta.685 | 40 | 7/9/2026 |
| 13.4.1-beta.683 | 36 | 7/9/2026 |