This package provides a native .NET binding for Apache OpenDAL™, a data access layer that allows you to access various storage services in a unified way.
We release the OpenDAL .NET binding independently of the opendal crate (Rust core). For updates and compatibility, use the .NET binding version instead of the opendal crate version.
This binding is not yet published to NuGet. Build it from source — you need the .NET SDK for net8.0 or net10.0 and a Rust toolchain for the native library:
cargo build
dotnet build
using OpenDAL; using System.Text; // Configure a service, then build an operator from it. using var op = new Operator("memory"); // The same verbs work on every service. op.Write("hello.txt", Encoding.UTF8.GetBytes("Hello, World!")); var bytes = op.Read("hello.txt"); Console.WriteLine(Encoding.UTF8.GetString(bytes)); Console.WriteLine(op.Stat("hello.txt").ContentLength);
To use a real backend, change the scheme and pass its configuration — the operations stay identical:
using var op = new Operator("s3", new Dictionary<string, string> { ["bucket"] = "your_bucket", ["region"] = "your_region", });
OpenDAL also has a first-class async API — every operation has an …Async counterpart. See Getting started and Connecting to your storage for the full guide.
To build and test the binding from source:
cargo build
dotnet build
dotnet test
For a complete guide on building, testing, and contributing, see the project's CONTRIBUTING guide.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.