LtMsgPack 2026.10.10.2
See the version list below for details.
dotnet add package LtMsgPack --version 2026.10.10.2
NuGet\Install-Package LtMsgPack -Version 2026.10.10.2
<PackageReference Include="LtMsgPack" Version="2026.10.10.2" />
<PackageVersion Include="LtMsgPack" Version="2026.10.10.2" />
<PackageReference Include="LtMsgPack" />
paket add LtMsgPack --version 2026.10.10.2
#r "nuget: LtMsgPack, 2026.10.10.2"
#:package LtMsgPack@2026.10.10.2
#addin nuget:?package=LtMsgPack&version=2026.10.10.2
#tool nuget:?package=LtMsgPack&version=2026.10.10.2
LtMsgPack
Fast MsgPack serializer for .NET classes, used like the xml and json serializers. It writes and reads your objects directly, without an intermediate item tree. On the invoices of the benchmark it writes about 3-4x and reads about 4x as fast as System.Text.Json, with 35-47% smaller payloads.
- Indexed schema (on by default): each message lists its types and property names once, and the body refers to them by index. Messages are smaller, and data written by older or newer versions of your classes still loads.
- Polymorphism out of the box: a type id is written where a value's type differs from the declared type (a
List<IShape>holding circles and squares), without extra attributes. - Presets for exchanging data with MessagePack-CSharp, Nerdbank.MessagePack and non-.NET libraries (Python, JavaScript...).
- Writes and reads exactly the same data as the LsMsgPack serializer with the same settings.
- Targets .NET Standard 2.0 and 2.1: .NET Framework 4.6.2+, .NET, MAUI, Avalonia...
Usage
using LtMsgPack;
// Create one serializer per set of options and keep it: it's thread-safe and builds its plans per type once
LtMsgPackSerializer serializer = new LtMsgPackSerializer(); // or LtMsgPackSerializer.Default
byte[] data = serializer.Serialize(order);
Order copy = serializer.Deserialize<Order>(data);
There are also overloads that write to and read from a Stream.
Settings
Pass an LtMsgPackOptions to the constructor (the options are copied):
using LsMsgPack;
LtMsgPackSerializer serializer = new LtMsgPackSerializer(new LtMsgPackOptions
{
UseInexedSchema = false,
ObjectLayout = ObjectLayout.Map
});
To exchange data with other MsgPack libraries, start from a preset:
LtMsgPackSerializer serializer = new LtMsgPackSerializer(LtMsgPackPresets.MessagePackCSharp()); // or Nerdbank(), Generic()
Reading data you don't trust
Type ids let the data pick the classes that are created. The serializer only creates types assignable to the declared type. To restrict them further, set a type guard:
using LsMsgPack.TypeResolving.Types;
LtMsgPackOptions options = new LtMsgPackOptions();
options.TypeGuard = new AllowedTypesGuard().AllowAssemblyOf(typeof(IShape));
Documentation
- Client applications: files, web services, trimming
- Wire formats, the indexed schema and polymorphism
- Compatibility with other MsgPack libraries
- Security
- Reporting differences: what didn't match between the data and your classes (
serializer.Deserialize<T>(data, out ReadDifferences differences)) - ASP.NET formatters built on LtMsgPack: LsMsgPack.AspNetCore, LsMsgPack.AspNet.WebApi, LsMsgPack.AspNet.Mvc
- Source, issues and MsgPack Explorer (a tool to look inside MsgPack data): github.com/mlsomers/LsMsgPack
| 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 was computed. 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 was computed. 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 was computed. 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 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. 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. |
-
.NETStandard 2.0
- LsMsgPack.Core (>= 2026.10.10.2)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
.NETStandard 2.1
- LsMsgPack.Core (>= 2026.10.10.2)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on LtMsgPack:
| Package | Downloads |
|---|---|
|
LtMsgPack.Data
Rows of an ADO.NET data reader as MsgPack without a class in between (result sets and table dumps as LtMsgPack streams, with an index for files), dumps read back as a DbDataReader (e.g. for SqlBulkCopy), and rows into objects. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 2026.11.9.2 | 250 | 11/9/2026 | |
| 2026.11.9.1 | 207 | 11/9/2026 | |
| 2026.11.8.1 | 208 | 11/7/2026 | |
| 2026.11.6.1 | 207 | 11/6/2026 | |
| 2026.11.3.1 | 210 | 11/3/2026 | |
| 2026.10.29.1 | 176 | 10/29/2026 | |
| 2026.10.28.2 | 176 | 10/28/2026 | |
| 2026.10.28.1 | 186 | 10/28/2026 | |
| 2026.10.27.1 | 175 | 10/27/2026 | |
| 2026.10.26.1 | 166 | 10/26/2026 | |
| 2026.10.24.1 | 187 | 10/23/2026 | |
| 2026.10.22.1 | 173 | 10/22/2026 | |
| 2026.10.11.1 | 164 | 10/10/2026 | |
| 2026.10.10.2 | 165 | 10/10/2026 | |
| 2026.10.10.1 | 163 | 10/10/2026 | |
| 2026.10.8.1 | 167 | 10/8/2026 | |
| 2026.10.7.1 | 177 | 10/7/2026 | |
| 2026.10.6.4 | 179 | 10/6/2026 | |
| 2026.10.6.1 | 173 | 10/6/2026 | |
| 2026.10.5.3 | 178 | 10/5/2026 |