OneYaml 1.2.1

dotnet add package OneYaml --version 1.2.1
                    
NuGet\Install-Package OneYaml -Version 1.2.1
                    
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="OneYaml" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OneYaml" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="OneYaml" />
                    
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 OneYaml --version 1.2.1
                    
#r "nuget: OneYaml, 1.2.1"
                    
#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 OneYaml@1.2.1
                    
#: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=OneYaml&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=OneYaml&version=1.2.1
                    
Install as a Cake Tool

OneYaml

Lossless, comment-preserving editing and a System.Text.Json-style serializer for YAML 1.2, in one .NET package. Both run on one parser, so a typed read and an edit never disagree about what a file means. Pure C#, correct YAML 1.2 by default; nesting, alias expansion and integer size are bounded unless you lift the limits.

How many times faster OneYaml is than the strongest other .NET YAML library on each task (wall-clock time, log scale, higher is better; a task where OneYaml is slower shows as a slower bar):

Bar chart: how many times faster OneYaml is than the strongest other .NET YAML library on each task, wall-clock time, log scale, higher is better. The numbers are in the linked results.

Full results, with every loss and the method →

Install

dotnet add package OneYaml

Quick start

Change two values in a file, keeping the comment, the block scalar and every other byte as they were; then bind the original text to a record.

using OneYaml;

string src = """
    # Build settings
    script: |
      make build
    replicas: 2      # the CI job scales this
    """;

using var doc = YamlDocument.Parse(src);
doc.Set("/script", "make build\nmake test\n"); // still a block literal
doc.Root["replicas"] = 3;                      // only the 2 changes
Console.WriteLine(doc);
// # Build settings
// script: |
//   make build
//   make test
// replicas: 3      # the CI job scales this

var cfg = YamlSerializer.Deserialize<Config>(src)!;
Console.WriteLine($"{cfg.Replicas} replicas"); // 2 replicas

record Config(int Replicas, string Script);

Documentation

Report problems at GitHub issues. Licensed under MIT or Apache-2.0, at your option.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on OneYaml:

Package Downloads
OneYaml.Compat.YamlDotNet

A compatibility adapter covering a subset of YamlDotNet's API (serializer builders and representation model), tested against YamlDotNet 18.1.0, running on OneYaml. Every difference is listed.

OneYaml.Compat.SharpYaml

A compatibility adapter covering a subset of the SharpYaml serializer API (YamlSerializer, YamlSerializerOptions, attributes), tested against SharpYaml 3.14.0, running on OneYaml. Every difference is listed.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 122 10/18/2026
1.2.0 127 10/18/2026
1.1.1 208 10/17/2026
1.1.0 143 10/17/2026
1.0.0 180 10/16/2026