This repository contains the C# SDK for integrating with Lore.
Lore is an open source version control system that is designed for unprecedented scalability of both data and teams. It is optimized for projects that combine code with large binary assets, including games and entertainment, and caters to the needs of developers and artists alike.
For full Lore documentation, architecture details, and contribution guidelines, visit the main Lore repository.
dotnet add package LoreVcs --project /<path-to>/project.csprojThe top-level LoreVcs namespace exposes the high-level fluent API. A low-level, C-like wrapper around the underlying FFI is also available under LoreVcs.Interop for advanced use cases.
using LoreVcs;
using LoreVcs.Types;
using LoreVcs.Types.Args;
using LoreVcs.Types.Enums;
using LoreVcs.Types.Events;
var globalArgs = new LoreGlobalArgs { RepositoryPath = "/path/to/local/repository" };
var statusArgs = new LoreRepositoryStatusArgs { Staged = true, Scan = true };
Lore.LogConfigure(new LoreLogConfig { File = true, FilePath = "/path/to/log/directory", Level = LoreLogLevel.DEBUG });
Lore.RepositoryStatus(globalArgs, statusArgs)
.Callback((evt, ctx) =>
{
if (evt.Tag == LoreEventTag.REPOSITORY_STATUS_FILE)
{
var statusEvent = evt.GetData<LoreRepositoryStatusFileEventDataFFI>();
Console.WriteLine(statusEvent.Path);
}
})
.Wait();LoreVcs carries no native library itself. The native lorelib is delivered by a separate LoreVcs.runtime.<rid> package that NuGet pulls in only during a RID-qualified restore. You therefore have to tell .NET which platform you are targeting. There are two ways to do it:
- (Recommended) Set it once in your project file:
<PropertyGroup>
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
</PropertyGroup>Then run your project with no extra flags:
dotnet run --project /<path-to>/project.csproj- Pass the RID on each command:
dotnet run --project /<path-to>/project.csproj -r <runtime-identifier>Supported runtime identifiers for the LoreVcs package are
- osx-arm64
- win-x64
- linux-x64
See .NET RID Catalog for more information on runtime identifiers
For comprehensive examples, see the examples directory. Both examples/example/Program.cs (fluent API) and examples/example-native/Program.cs (low-level native API) run offline by default; pass a remote URL (e.g. lore://localhost) as the first argument to exercise the online push/clone flow. See examples/README.md for details, including how to run a local Lore server.
- Clone the Lore C# SDK repository
git clone https://github.com/EpicGames/lore-dotnet- Install the .NET 9 SDK or the .NET 10 SDK from https://dotnet.microsoft.com/en-us/download
Every project in this repository targets both net9.0 and net10.0. How you build depends on which SDK you have:
| SDK | Commands |
|---|---|
| .NET 10 | Builds both frameworks. Pass --framework net10.0 to dotnet run; net9.0 also works if a .NET 9 runtime is installed. dotnet test runs both frameworks, so it also needs a .NET 9 runtime (or add --framework net10.0 to run only one). |
| .NET 9 | Cannot build net10.0, and restore evaluates every target framework even when you pass --framework net9.0. Add -p:TargetFrameworks=net9.0 to every dotnet run, dotnet test and dotnet build command, and keep --framework net9.0 on dotnet run. |
For example, with the .NET 9 SDK:
dotnet run --project examples/example/example.csproj -p:TargetFrameworks=net9.0 --framework net9.0
dotnet test LoreVcs.Tests -p:TargetFrameworks=net9.0Packing release packages (dotnet pack) should produce both frameworks, so use the .NET 10 SDK for it.
- Install CSharpier
dotnet new tool-manifest
dotnet tool install csharpierIf dotnet-tools.json already exists (for example, you've run the step above before), dotnet new tool-manifest fails because the file is already there. Run dotnet tool restore instead to install the pinned version.
- Create a virtual environment and activate it:
uv venv .venv
source .venv/bin/activate- Install the dev tooling:
uv pip install --group devThe SDK binds against the Lore C library. Pick one of the two options below depending on whether you're also modifying the Lore core.
Use this when you're changing the Lore C/Rust core alongside the C# SDK.
- Clone Lore's repository and build it:
cargo build --release- Set the environment variable
LORE_BUILD_PATHto point to the release build path:
export LORE_BUILD_PATH="/<path-to>/lore/target/release"Use this when you only need to develop the C# SDK against an existing Lore version.
-
Download the header and binaries from the Lore repository release page and place them under
/<path-to>/lore/ -
Set the environment variable
LORE_BUILD_PATHto point to the download path:
export LORE_BUILD_PATH="/<path-to>/lore/"With LORE_BUILD_PATH set (see Get the Lore library), generate the C# bindings from it:
uv run python find_lorelib.py
uv run python generator/generate.pyIf you change anything under generator/templates or pull a new Lore pre-built binary, re-run the commands above to regenerate the bindings.
The example projects reference LoreVcs via ProjectReference, so they pick up the freshly built assembly and the host's native library directly from your working tree. No runtime identifier is needed as the native library is copied next to the build output.
The examples target both net9.0 and net10.0, so dotnet run needs --framework to pick one. With the .NET 10 SDK:
dotnet run --project examples/example/example.csproj --framework net10.0With the .NET 9 SDK, add -p:TargetFrameworks=net9.0 and use --framework net9.0 (see step 2).
Replace example with example-native to run the low-level native example. See examples/README.md for offline/online run modes and local server setup.
Run the Get the Lore library and Generate the C# bindings steps first (find_lorelib.py then generator/generate.py): the tests consume LoreVcs via ProjectReference and need the regenerated bindings and the host's native library present.
dotnet test LoreVcs.Tests --logger "console;verbosity=detailed"This runs the tests on both net9.0 and net10.0. With the .NET 9 SDK, add -p:TargetFrameworks=net9.0 (see step 2).
Format the code with CSharpier (installed during Set up your dev environment). Run it before opening a PR so the source stays consistently formatted for users.
dotnet csharpier format .