CodeLogic.Storage 4.6.75-preview

This is a prerelease version of CodeLogic.Storage.
This package has a SemVer 2.0.0 package version: 4.6.75-preview+788b284.
There is a newer version of this package available.
See the version list below for details.
dotnet add package CodeLogic.Storage --version 4.6.75-preview
                    
NuGet\Install-Package CodeLogic.Storage -Version 4.6.75-preview
                    
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="CodeLogic.Storage" Version="4.6.75-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeLogic.Storage" Version="4.6.75-preview" />
                    
Directory.Packages.props
<PackageReference Include="CodeLogic.Storage" />
                    
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 CodeLogic.Storage --version 4.6.75-preview
                    
#r "nuget: CodeLogic.Storage, 4.6.75-preview"
                    
#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 CodeLogic.Storage@4.6.75-preview
                    
#: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=CodeLogic.Storage&version=4.6.75-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CodeLogic.Storage&version=4.6.75-preview&prerelease
                    
Install as a Cake Tool

CodeLogic.Storage

One provider-neutral storage library for CodeLogic applications. The same IStorageService operations work with:

  • local directories and UNC shares
  • Amazon S3 and S3-compatible services such as MinIO, R2, and Spaces
  • FTP, explicit FTPS, and implicit FTPS
  • SFTP
  • WebDAV
  • Azure Blob Storage
  • Google Cloud Storage
  • OpenStack Swift

The common surface covers item information, existence checks, directory and recursive listing, streamed and byte-array upload/download, ranges, directory creation, deletion, copy, move, health checks, metadata, pagination, and cancellation.

Named connections and JSON configuration

Each provider has a typed Connections dictionary in its own CodeLogic configuration section and JSON file:

Section Connection type
storage.local LocalConnectionConfig
storage.s3 S3ConnectionConfig
storage.ftp FtpConnectionConfig
storage.sftp SftpConnectionConfig
storage.webdav WebDavConnectionConfig
storage.azure AzureBlobConnectionConfig
storage.gcs GoogleCloudConnectionConfig
storage.swift SwiftConnectionConfig

For example, config.storage.s3.json can contain:

{
  "Connections": {
    "media": {
      "Enabled": true,
      "Bucket": "company-media",
      "Prefix": "production",
      "Region": "eu-north-1",
      "AuthenticationMode": "DefaultCredentialChain"
    },
    "minio": {
      "Enabled": true,
      "Bucket": "documents",
      "ServiceUrl": "https://minio.example.com",
      "Region": "us-east-1",
      "ForcePathStyle": true,
      "AuthenticationMode": "StaticCredentials",
      "AccessKey": "...",
      "SecretKey": "..."
    }
  }
}

Connection IDs are case-insensitive and unique across every provider. The default ID is selected in the storage section.

Common API

IStorageService media = storage.GetStorage("media");

await using var input = File.OpenRead("photo.jpg");
var uploaded = await media.UploadAsync("photos/photo.jpg", input);

var page = await media.ListAsync("photos", new StorageListOptions
{
    Recursive = true,
    PageSize = 250
});

var bytes = await media.DownloadBytesAsync("photos/photo.jpg", new StorageDownloadOptions
{
    Offset = 1024,
    Length = 4096
});

Connections can be changed at runtime with the same typed models. By default, the change is persisted back to the provider's JSON section:

await storage.AddOrUpdateConnectionAsync("backup", new SftpConnectionConfig
{
    Host = "sftp.example.com",
    Username = "backup",
    AuthenticationMode = SftpAuthenticationMode.PrivateKey,
    PrivateKeyPath = @"C:\keys\backup_ed25519",
    HostKeyFingerprints = ["SHA256:..."]
});

await storage.RemoveConnectionAsync("backup", persist: true);

Pass persist: false for a runtime-only connection.

Native clients and direct connections

Reusable SDK clients are available for providers such as S3, WebDAV, Azure Blob, Google Cloud Storage, and Swift:

IAmazonS3 s3 = storage.GetNativeClient<IAmazonS3>("media");
BlobContainerClient blobs = storage.GetNativeClient<BlobContainerClient>("azure-media");

Session-oriented providers expose a scoped native connection:

var opened = await storage.OpenNativeConnectionAsync<AsyncFtpClient>("legacy-ftp");
if (opened.IsSuccess)
{
    await using var lease = opened.Value!;
    AsyncFtpClient ftp = lease.Client;
    // Use the connected FluentFTP client directly.
}

Every built-in backend also has a public constructor accepting its native client or client factory. A directly constructed backend can be installed with StorageLibrary.RegisterBackend, which makes custom endpoints and application-owned clients possible without going through JSON configuration.

Native clients returned by the library remain library-owned. Do not dispose reusable clients. Dispose native session leases when finished.

Product Compatible and additional computed target framework versions.
.NET 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
4.6.79 15 8/2/2026
4.6.78 17 8/2/2026
4.6.77-preview 12 8/2/2026
4.6.76-preview 19 8/2/2026
4.6.75-preview 20 8/1/2026

# Changelog

## Unreleased

- Added production adapters and typed JSON configuration for S3-compatible storage,
 FTP/FTPS, SFTP, WebDAV, Azure Blob Storage, Google Cloud Storage, and OpenStack Swift.
- Added provider-native client access, session leases, direct backend constructors, and
 persisted runtime add/update/remove support for every built-in provider.
- Added the CodeLogic lifecycle-aware connection registry, local configuration persistence,
 stable operation-leased service proxies, native access, generic mutation events, and
 concurrent bounded health checks.
- Added the provider-neutral storage contract, configuration models, path rules, and local provider.