NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet, #106 most downloaded on NuGet
YamlDotNet is a .NET library for YAML. YamlDotNet provides low level parsing and emitting of YAML as well as a high level object model similar to XmlDocument. A serialization library is also included that allows to read and write objects from and to YAML streams.
Latest stable
18.1.0
Last release 4 months ago
26 Jun 2026
Ships unpredictably
gaps range from 2 weeks to 1.3 years
Nearly every release is documented
notes for 58 of 59 stable releases
210 versions withdrawn
withdrawn after publishing
127 years old
270 releases · first in 1900
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
[YamlMember(Description = "This is the age")] public int Age { get; set; }
YamlMember attribute now has a Description property. When set, a comment is emitted when serializing that property:class Person
{
public string Name { get; set; }
[YamlMember(Description = "This is the age")]
public int Age { get; set; }
[YamlMember(Description = "male or female")]
public string Sex { get; set; }
}
Name: PandaTea
# This is the age
Age: 100
# male or female
Sex: male
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
item2 ` By using this option, the emitter will output: ` list:
list:
- item1
- item2
By using this option, the emitter will output:list:
- item1
- item2
AnchorNotFoundException if there is a reference to an anchor of a node which is being deserialized. This happens in cyclic references.Breaking - Binary serialization support has been removed as there was no practical use-case for it.
Refactor Portability.cs into conditionally included files to improve maintainability.
There is now a set of directories under YamlDotNet/Helpers/Portability. Each directory's name contains a list of target platforms, separated by +. Each of those files is included only when building for one of those target platforms. Each directory may also contain a subsirectory named others. The files in this directory are included only when building for one target platform that is not in it's parent name.
Make the type Nothing a ValueType
There's no need for it to be a reference type.
Use a custom type to represent anchor names
This enables the compiler to detect when we pass something else
where an anchor name is expected.
Use a custom type to represent tag names
This enables the compiler to detect when we pass something else
where a tag name is expected.
Release notes are no longer stored in the repository, because this forced a new meaningless commit to be created for each release.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fix LookAheadBuffer trying to read from the stream after reaching its end
Nothing published for this version
Fix an error when a stream returns less than the requested amount of bytes Fixes #560
Fix writePtr decrementation in InsertionQueue [#558]
This fixes another critical bug that was causing failures while parsing Yaml documents. If you are using release 9.1.1, please use this version instead.
Fix off by one error when resizing InsertionQueue
This fixes a critical bug that was causing failures while parsing Yaml documents. If you are using release 9.1.0, please use this version instead.
Small performance improvements. Addresses [#519]
Merge #483 - Allow values after DocumentStart token
Improve compliance with the official YAML test suite: #467, #469 and #475.
Improve compliance with the official YAML test suite: #467, #469 and #475.
Make YamlMemberAttribute.DefaultValuesHandling actually usable. Fixes #466.
Actually inherit YamlIgnore attributes: #481.
Made CachedTypeInspector thread safe #386 Previously, using an instance of Serializer or Deserializer was not thread-safe, although the intention was
Serializer or Deserializer was not thread-safe,
although the intention was for them to be thread safe. The only mutable state is
inside CachedTypeInspector and was not properly protected against concurrent mutation.Change the default value handling behavior. Fixes #427 This is a breaking change to the default behaviour of the serializer, which will now always emi…
Change the default value handling behavior. Fixes #427
This is a breaking change to the default behaviour of the serializer, which will now always emit null and default values.
It is possible to configure this behaviour by using the ConfigureDefaultValuesHandling method on SerializerBuilder.
Add default implementations for the following non-generic collections to DefaultObjectFactory:
Remove obsolete and unused SerializationOptions enum. Fixes #438
Throw descriptive exceptions when using the "linq" methods of YamlNode. Relates to #437
Nothing published for this version
Nothing published for this version
Because fixing these problems required some breaking changes, a few improvements were made to the code base to take advantage of modern C# constructs.
Added support for nullable references and netstandard 2.1.
Enabling nullable references exposed many potential bugs where the code assumed that a reference would not be null, but where it was possible for it to be null. In most cases this did not cause an error because of the way the code was being used.
Because fixing these problems required some breaking changes, a few improvements were made to the code base to take advantage of modern C# constructs.
Overall, the following breaking changes were made:
Removed the default constructor from most exceptions, because that would cause some uninitialized properties.
Made the ParsingEvent concretizations sealed. There is no point in inheriting from these because the library assumes that they form a closed set.
Made many classes sealed, since they are not intended to be extended.
YamlDocument now throws an exception if is has no root node after loading. This should only happen when loading from an IParser that returns invalid data or is in an invalid state.
The following APIs were made obsolete (but still work as before):
Refactored the extension methods to IParser to have better names with a more sensible semantic. The previous extension methods, Expect<T>, Allow<T>, Peek<T> and Accept<T> are still available but have been deprecated. The new extension methods are:
T Consume<T>() where T : ParsingEvent
Ensures that the current event is of the specified type, returns it and moves to the next event. Throws an exception if the next event is not of the expected type.
bool TryConsume<T>(out T @event) where T : ParsingEvent
If the event is of the specified type, returns it and moves to the next event, otherwise returns null.
T Require<T>() where T : ParsingEvent
Enforces that the current event is of the specified type.
bool Accept<T>(out T @event) where T : ParsingEvent
Checks whether the current event is of the specified type.
Made the constructor of all naming conventions obsolete. Instead each has a static property named Instance. There was no point in creating multiple instances of those classes.
Instead of:
new SerializerBuilder()
.WithNamingConvention(new CamelCaseNamingConvention());
Use:
new SerializerBuilder()
.WithNamingConvention(CamelCaseNamingConvention.Instance);
Nothing published for this version
Improves conformance with the official test suite:
Improves conformance with the official test suite:
Also adds the license file to nupkg to fix NU5125 warning.
Tests from yaml-test-suite have been added to the project and an effort has been made to improve the conformance, thanks to @am11:
Tests from yaml-test-suite have been added to the project and an effort has been made to improve the conformance, thanks to @am11:
YamlStream to an IEmitterThe assemblies in the YamlDotNet package will now have strong names. This is a breaking change. If you depend on a library that depends on a previous…
This release merges the YamlDotNet.Signed and YamlDotNet packages, as discussed in #390. This change has the following consequences:
The assemblies in the YamlDotNet package will now have strong names.
This is a breaking change. If you depend on a library that depends on a
previous version of YamlDotNet, you will first need to update that library.
The YamlDotNet.Signed package will cease to be published.
The code should be updated to depend on YamlDotNet.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
YamlDotNet will now also serialize public fields. This feature is enabled by default, but it can be disabled by calling IgnoreFields() on the Serializ
YamlDotNet will now also serialize public fields. This feature is enabled by default, but it can be disabled by calling IgnoreFields() on the SerializerBuilder or DeserializerBuilder.
Produce a detailed error message when too much recursion is detected during serialization.
New features:
Add support for supplying custom IObjectGraphTraversalStrategy implementations.
New features:
Bug fixes:
Fix roundtripping of tags on sequences
Nothing published for this version
Nothing published for this version
Allow to specify the maximum recusion limit (fixes #352) with the WithMaximumRecursion method.
Improvements:
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add interfaces for serializer and deserializer (fixes #350).
Improvements:
Fixes:
Nothing published for this version
Nothing published for this version
This release adds the repository location to the package metadata. No functional changes were made.
This release adds the repository location to the package metadata. No functional changes were made.
Nothing published for this version
/!\ This release fixes a security issue. It is strongly recommended to upgrade, mainly if you are parsing documents from sources that you do not trust
/!\ This release fixes a security issue. It is strongly recommended to upgrade, mainly if you are parsing documents from sources that you do not trust.
Many thanks to Kurt Boberg, from the DocuSign Application Security Team, who identified this issue and provided feedback on mitigation strategies.
Remove the legacy backwards-compatibe syntax that enabled to create
Serializer and Deserializer directly then changing their configutation.
In most cases, the calls to the constructors should be replaced by
instantiations of SerializerBuilder and DeserializerBuilder.
These can be configured at will, then used to create instances of
(De)serializer.
It is still possible to use the default constructors, if no configuration is needed.
Drop support for specifying arbitrary type names in tags.
Support for automatically resolving a fully qualified type name
from a tag has been discontinued. That feature was poorly designed
and not standard.
During deserialization, each tag mapping must be explicitly registered.
During serialization, when using the EnsureRoundtrip method, it is necessary to
register tag mappings for each type that will require a tag, that is, any type that
is used as the value of a property with a different declared type.
Fix bug where deserialized values were not being converted to the destination type.
var sut = new DeserializerBuilder()
.WithTagMapping("!dbl", typeof(DoublyConverted))
.Build();
// The scalar "hello" will first be converted to DoublyConverted
// then that value will be converted to int.
var result = sut.Deserialize<int>("!dbl hello");
Assert.Equal(5, result);
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.