CodeLogic.Storage
4.6.75-preview
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
<PackageReference Include="CodeLogic.Storage" Version="4.6.75-preview" />
<PackageVersion Include="CodeLogic.Storage" Version="4.6.75-preview" />
<PackageReference Include="CodeLogic.Storage" />
paket add CodeLogic.Storage --version 4.6.75-preview
#r "nuget: CodeLogic.Storage, 4.6.75-preview"
#:package CodeLogic.Storage@4.6.75-preview
#addin nuget:?package=CodeLogic.Storage&version=4.6.75-preview&prerelease
#tool nuget:?package=CodeLogic.Storage&version=4.6.75-preview&prerelease
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 | Versions 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. |
-
net10.0
- AWSSDK.S3 (>= 4.0.101.6)
- Azure.Identity (>= 1.21.0)
- Azure.Storage.Blobs (>= 12.29.1)
- CodeLogic (>= 4.0.0 && < 5.0.0)
- FluentFTP (>= 54.2.0)
- Google.Cloud.Storage.V1 (>= 4.15.0)
- SSH.NET (>= 2025.1.0)
- WebDAVClient (>= 2.7.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 |
|---|---|---|
| 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.