Meziantou.Framework.HumanReadableSerializer
3.0.2
Prefix Reserved
See the version list below for details.
dotnet add package Meziantou.Framework.HumanReadableSerializer --version 3.0.2
NuGet\Install-Package Meziantou.Framework.HumanReadableSerializer -Version 3.0.2
<PackageReference Include="Meziantou.Framework.HumanReadableSerializer" Version="3.0.2" />
<PackageVersion Include="Meziantou.Framework.HumanReadableSerializer" Version="3.0.2" />
<PackageReference Include="Meziantou.Framework.HumanReadableSerializer" />
paket add Meziantou.Framework.HumanReadableSerializer --version 3.0.2
#r "nuget: Meziantou.Framework.HumanReadableSerializer, 3.0.2"
#:package Meziantou.Framework.HumanReadableSerializer@3.0.2
#addin nuget:?package=Meziantou.Framework.HumanReadableSerializer&version=3.0.2
#tool nuget:?package=Meziantou.Framework.HumanReadableSerializer&version=3.0.2
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 | Versions 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. |
-
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.3 | 3,558 | 5/31/2026 |
| 3.0.2 | 664 | 5/23/2026 |
| 3.0.1 | 914 | 5/14/2026 |
| 3.0.0 | 2,653 | 5/6/2026 |
| 2.4.22 | 4,163 | 4/25/2026 |
| 2.4.21 | 7,524 | 3/29/2026 |
| 2.4.20 | 2,285 | 3/22/2026 |
| 2.4.19 | 1,542 | 3/15/2026 |
| 2.4.18 | 6,068 | 2/22/2026 |
| 2.4.17 | 3,332 | 1/25/2026 |
| 2.4.16 | 444 | 1/18/2026 |
| 2.4.15 | 8,566 | 12/14/2025 |
| 2.4.14 | 11,578 | 11/16/2025 |
| 2.4.13 | 4,085 | 11/2/2025 |
| 2.4.12 | 2,365 | 10/19/2025 |
| 2.4.11 | 12,825 | 9/16/2025 |
| 2.4.10 | 3,437 | 9/3/2025 |
| 2.4.9 | 20,964 | 8/10/2025 |
| 2.4.8 | 2,845 | 7/13/2025 |
| 2.4.7 | 3,860 | 6/15/2025 |