Meziantou.Framework.HumanReadableSerializer 3.0.0

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

Meziantou.Framework.HumanReadableSerializer

One-way serializer to an invariant human-readable format. You can use HumanReadableSerializer.Serialize to convert an object to a string:

var obj = new { Name = "G�rald Barr�", Nickname = "meziantou", Age = 32, MultiLineString = "line1\nline2" };
var output = HumanReadableSerializer.Serialize(obj);

output contains the following value:

Name: G�rald Barr�
Nickname: meziantou
Age: 32
MultiLineString:
  line1
  line2

You can customize the serializer using an instance of HumanReadableSerializerOptions or by using attributes:

var options = new HumanReadableSerializerOptions()
{
    IncludeFields = true,
    DefaultIgnoreCondition = HumanReadableIgnoreCondition.WhenWritingNull,
};
HumanReadableSerializer.Serialize(obj, options);

Available attributes:

  • [HumanReadableIgnore] allows to ignore a property or a field
  • [HumanReadableIncludeAttribute] allows to include a property or a field
  • [HumanReadablePropertyNameAttribute] allows to set the name of a property or a field when serializing the value
  • [HumanReadablePropertyOrderAttribute] allows to order the properties when serializing an object
  • [HumanReadableConverterAttribute] allows to set the converter to use to serialize a property, a field, or a type

You can customize a type you don't own by using the following:

var options = new HumanReadableSerializerOptions();

// Add the HumanReadableIgnoreAttribute to the User.DisplayName property
options.AddAttribute(typeof(User), "DisplayName", new HumanReadableIgnoreAttribute());

options.IgnoreMember<User>(x => x.DisplayName);
options.IgnoreMember<User>(x => new { x.DisplayName, x.CreatedAt });
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 is compatible.  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.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Meziantou.Framework.HumanReadableSerializer:

Package Downloads
Meziantou.Framework.InlineSnapshotTesting

Enables verification of objects using inline snapshots

Meziantou.Framework.SnapshotTesting

Enables verification of objects using file-based snapshots

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 335 5/6/2026
2.4.22 3,902 4/25/2026
2.4.21 7,072 3/29/2026
2.4.20 2,099 3/22/2026
2.4.19 1,301 3/15/2026
2.4.18 6,051 2/22/2026
2.4.17 3,283 1/25/2026
2.4.16 430 1/18/2026
2.4.15 8,166 12/14/2025
2.4.14 11,090 11/16/2025
2.4.13 4,072 11/2/2025
2.4.12 2,317 10/19/2025
2.4.11 12,816 9/16/2025
2.4.10 3,425 9/3/2025
2.4.9 18,342 8/10/2025
2.4.8 2,829 7/13/2025
2.4.7 3,845 6/15/2025
2.4.6 311 5/25/2025
2.4.5 3,402 5/18/2025
2.4.4 8,684 4/13/2025
Loading failed