This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
MinIO .NET SDK - A modern C# client library for MinIO S3-compatible object storage. Multi-targeted for .NET 8.0 and later.
Make sure you have installed a recent .NET SDK.
# Build
dotnet build
# Run unit tests
dotnet test Minio.UnitTests
# Run a single unit test
dotnet test Minio.UnitTests --filter "FullyQualifiedName~TestMethodName"
# Run integration tests (requires Docker for Testcontainers)
dotnet test Minio.IntegrationTestsMinio/ - Core SDK library
Minio.UnitTests/ - Unit tests (xUnit)
Minio.IntegrationTests/ - Integration tests using Testcontainers (MinIO, Keycloak, NATS)
Minio.Examples.Simple/ - Minimal console example
Minio.Examples.Host/ - DI-based example with IHost
Two patterns for creating the MinIO client:
Direct builder:
var client = new MinioClientBuilder("https://minio.example.com")
.WithStaticCredentials("accessKey", "secretKey")
.Build();Dependency Injection:
services
.AddMinio("http://localhost:9000")
.WithStaticCredentials("minioadmin", "minioadmin");IMinioClient- Main interface with bucket and object operationsMinioClientBuilder- Fluent builder for direct client creationIMinioBuilder- DI configuration builder (viaAddMinioextension)ICredentialsProvider- Interface for credentials (static, environment, or STS/OIDC)V4RequestAuthenticator- AWS Signature Version 4 request signing
EnvironmentCredentialsProvider- UsesMINIO_ROOT_USERandMINIO_ROOT_PASSWORDenv varsStaticCredentialsProvider- Hardcoded credentialsWebIdentityCredentialsProvider- STS/OIDC token-based authentication
- Polly retry policy with exponential backoff (5 retries, 250ms median first delay)
- Retryable status codes: 408, 423, 429, 500, 502, 503, 504
- All async operations support
CancellationToken - Streaming operations use
IAsyncEnumerable<T>for collections andIObservable<T>for notifications
- Nullable reference types enabled throughout
InternalsVisibleToallows unit tests to access internal classes- XML documentation generation is enabled
- Uses
Microsoft.Extensions.*patterns for DI, logging, and options - Public API is documented with XML comments
- All MinIO SDK and example code should be compatible with .NET 6.0 and later.
- All unit and integration tests should be compatible with .NET 8.0 and later.