Skip to main content
.NETFramework4.7.2net8.0net9.0.NETStandard2.0

A fast and more user-friendly MessagePack serialization library for .NET and .NET Framework. This package is brought to you by one of the two major contributors to MessagePack-CSharp. As its natural successor, this library comes packed with features that its predecessor lacks, and has ongoing support. Premium support for trimming and Native AOT, secure deserialization of untrusted data, async serialization, streaming deserialization, skip serializing of default values, reference preservation, and support for reference cycles. Also features an automatic structural equality API.

Published
Oct 7, 2026
1mo ago
Total Downloads
15.6M
15,558,467

Install

dotnet add package Nerdbank.MessagePack --version 1.4.80
ProductVersions
.NET
net8.0net9.0
.NET Standard
netstandard2.0
Other
.NETFramework4.7.2

README

Nerdbank.MessagePack

A modern, fast and NativeAOT-compatible MessagePack serialization library

This is a fast and more user-friendly MessagePack serialization library for .NET and .NET Framework. This package is brought to you by one of the two major contributors to MessagePack-CSharp. As its natural successor, this library comes packed with features that its predecessor lacks, and has ongoing support.

Features

  • Serializes in the compact and fast MessagePack format.
  • Performance is on par with the highly tuned and popular MessagePack-CSharp library.
  • Automatically serialize any type annotated with the PolyType [GenerateShape] attribute or non-annotated types by adding a 'witness' type with a similar annotation.
  • Fast ref-based serialization and deserialization minimizes copying of large structs.
  • NativeAOT and trimming compatible.
  • Serialize only properties that have non-default values (optionally).
  • Keep memory pressure low by using async serialization directly to/from I/O like a network, IPC pipe or file.
  • Streaming deserialization for large or over-time sequences.
  • Primitive msgpack reader and writer APIs for low-level scenarios.
  • Author custom converters for advanced scenarios.
  • Security mitigations for stack overflows.
  • Optionally serialize your custom types as arrays of values instead of maps of names and value for more compact representation and even higher performance.
  • Support for serializing instances of certain types derived from the declared type and deserializing them back to their original runtime types using unions.
  • Optionally preserve reference equality across serialization/deserialization.
  • Structural (i.e. deep, by-value) equality checking for arbitrary types, both with and without collision resistant hash functions.

See how these features and more compare with the leading MessagePack library.

Changes from Previous Version

No structural changes between v1.4.52-alpha and v1.4.80.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 4 target frameworks; confirm the exact target used by your application.The published metadata declares 17 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.