Meziantou.Framework.HumanReadableSerializer
2.4.22
Prefix Reserved
dotnet add package Meziantou.Framework.HumanReadableSerializer --version 2.4.22
NuGet\Install-Package Meziantou.Framework.HumanReadableSerializer -Version 2.4.22
<PackageReference Include="Meziantou.Framework.HumanReadableSerializer" Version="2.4.22" />
<PackageVersion Include="Meziantou.Framework.HumanReadableSerializer" Version="2.4.22" />
<PackageReference Include="Meziantou.Framework.HumanReadableSerializer" />
paket add Meziantou.Framework.HumanReadableSerializer --version 2.4.22
#r "nuget: Meziantou.Framework.HumanReadableSerializer, 2.4.22"
#:package Meziantou.Framework.HumanReadableSerializer@2.4.22
#addin nuget:?package=Meziantou.Framework.HumanReadableSerializer&version=2.4.22
#tool nuget:?package=Meziantou.Framework.HumanReadableSerializer&version=2.4.22
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 | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.7)
- System.Memory (>= 4.6.3)
- System.Text.Json (>= 10.0.7)
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.7)
- System.Memory (>= 4.6.3)
- System.Text.Json (>= 10.0.7)
-
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 |
|---|---|---|
| 2.4.22 | 0 | 4/25/2026 |
| 2.4.21 | 5,701 | 3/29/2026 |
| 2.4.20 | 1,994 | 3/22/2026 |
| 2.4.19 | 1,003 | 3/15/2026 |
| 2.4.18 | 6,039 | 2/22/2026 |
| 2.4.17 | 3,270 | 1/25/2026 |
| 2.4.16 | 418 | 1/18/2026 |
| 2.4.15 | 8,068 | 12/14/2025 |
| 2.4.14 | 10,949 | 11/16/2025 |
| 2.4.13 | 4,055 | 11/2/2025 |
| 2.4.12 | 2,287 | 10/19/2025 |
| 2.4.11 | 12,807 | 9/16/2025 |
| 2.4.10 | 3,415 | 9/3/2025 |
| 2.4.9 | 17,576 | 8/10/2025 |
| 2.4.8 | 2,817 | 7/13/2025 |
| 2.4.7 | 3,837 | 6/15/2025 |
| 2.4.6 | 306 | 5/25/2025 |
| 2.4.5 | 3,392 | 5/18/2025 |
| 2.4.4 | 8,646 | 4/13/2025 |
| 2.4.3 | 1,474 | 3/23/2025 |