CommunityToolkit.Aspire.SeaweedFS.Client 13.4.1-beta.685

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.SeaweedFS.Client.
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
                    
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="CommunityToolkit.Aspire.SeaweedFS.Client" Version="13.4.1-beta.685" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.SeaweedFS.Client" Version="13.4.1-beta.685" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.SeaweedFS.Client" />
                    
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 CommunityToolkit.Aspire.SeaweedFS.Client --version 13.4.1-beta.685
                    
#r "nuget: CommunityToolkit.Aspire.SeaweedFS.Client, 13.4.1-beta.685"
                    
#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 CommunityToolkit.Aspire.SeaweedFS.Client@13.4.1-beta.685
                    
#: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=CommunityToolkit.Aspire.SeaweedFS.Client&version=13.4.1-beta.685&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.SeaweedFS.Client&version=13.4.1-beta.685&prerelease
                    
Install as a Cake Tool

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: ForcePathStyle defaults to true as 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

https://github.com/CommunityToolkit/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 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. 
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
13.4.1-beta.685 39 7/9/2026
13.4.1-beta.683 36 7/9/2026