SharpYaml

SharpYaml

High-performance YAML for .NET: parser, emitter, and a System.Text.Json-style object serializer.

dotnet add package SharpYaml

Available on NuGet — net8.0, net10.0, netstandard2.0

Familiar API
SharpYaml is intentionally shaped like System.Text.Json: YamlSerializer, YamlSerializerOptions, source-generated contexts, and a converter pipeline.
Two layers
Use the syntax/model layer for lossless parsing, spans, and tooling. Use YamlSerializer to map YAML into .NET objects (not roundtrip-preserving).
NativeAOT ready
Reflection fallback can be disabled. For NativeAOT and trimming, use generated metadata via YamlSerializerContext and YamlTypeInfo<T>.
JSON attribute interop
Most common System.Text.Json.Serialization attributes work out of the box (for example [JsonPropertyName], [JsonIgnore], [JsonConstructor]).
Quick example
using SharpYaml;

var yaml = YamlSerializer.Serialize(new { Name = "Ada", Age = 37 });

// Name: Ada
// Age: 37

var model = YamlSerializer.Deserialize<Person>(yaml);

Next: read the Getting started guide.