![]() |
VOOZH | about |
dotnet add package System.Formats.Nrbf --version 10.0.9
NuGet\Install-Package System.Formats.Nrbf -Version 10.0.9
<PackageReference Include="System.Formats.Nrbf" Version="10.0.9" />
<PackageVersion Include="System.Formats.Nrbf" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="System.Formats.Nrbf" />Project file
paket add System.Formats.Nrbf --version 10.0.9
#r "nuget: System.Formats.Nrbf, 10.0.9"
#:package System.Formats.Nrbf@10.0.9
#addin nuget:?package=System.Formats.Nrbf&version=10.0.9Install as a Cake Addin
#tool nuget:?package=System.Formats.Nrbf&version=10.0.9Install as a Cake Tool
System.Formats.Nrbf exposes only one component: NrbfDecoder: a stateless, forward-only decoder class that can decode .NET Remoting Binary Format (NRBF) binary data from a stream.
You can think of NrbfDecoder as being the equivalent of using a JSON/XML reader without the deserializer.
The NRBF payload consists of serialization records that represent the serialized objects and their metadata. To read the whole payload and get the root record, you need to call one of the NrbfDecoder.Decode methods.
The Decode method returns a SerializationRecord instance. SerializationRecord is an abstract class that represents the serialization record and provides three properties: Id, RecordType, and TypeName. It exposes one method, TypeNameMatches, which compares the type name read from the payload (and exposed via TypeName property) against the specified type. This method ignores assembly names, so you don't need to worry about type forwarding and assembly versioning. It also does not consider member names or their types (because getting this information would require type loading).
using System.Formats.Nrbf;
public class Sample
{
public int Integer;
public string? Text;
public byte[]? ArrayOfBytes;
public Sample? ClassInstance;
}
ClassRecord rootRecord = NrbfDecoder.DecodeClassRecord(payload);
Sample output = new()
{
// using the dedicated methods to read primitive values
Integer = rootRecord.GetInt32(nameof(Sample.Integer)),
Text = rootRecord.GetString(nameof(Sample.Text)),
// using dedicated method to read an array of bytes
ArrayOfBytes = ((SZArrayRecord<byte>)rootRecord.GetArrayRecord(nameof(Sample.ArrayOfBytes))).GetArray(),
// using GetClassRecord to read a class record
ClassInstance = new()
{
Text = rootRecord
.GetClassRecord(nameof(Sample.ClassInstance))!
.GetString(nameof(Sample.Text))
}
};
There are more than a dozen different serialization record types. This library provides a set of abstractions, so you only need to learn a few of them:
PrimitiveTypeRecord<T>: describes all primitive types natively supported by the NRBF (string, bool, byte, sbyte, char, short, ushort, int, uint, long, ulong, float, double, decimal, TimeSpan, and DateTime).
Value property.PrimitiveTypeRecord<T> derives from the non-generic PrimitiveTypeRecord, which also exposes a Value property. But on the base class, the value is returned as object (which introduces boxing for value types).class and struct besides the aforementioned primitive types.SZArrayRecord<T>: describes single-dimensional, zero-indexed array records, where T can be either a primitive type or a SerializationRecord.SerializationRecord rootObject = NrbfDecoder.Decode(payload); // payload is a Stream
if (rootObject is PrimitiveTypeRecord primitiveRecord)
{
Console.WriteLine($"It was a primitive value: '{primitiveRecord.Value}'");
}
else if (rootObject is ClassRecord classRecord)
{
Console.WriteLine($"It was a class record of '{classRecord.TypeName.AssemblyQualifiedName}' type name.");
}
else if (rootObject is SZArrayRecord<byte> arrayOfBytes)
{
Console.WriteLine($"It was an array of `{arrayOfBytes.Length}`-many bytes.");
}
System.Formats.Nrbf is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on System.Formats.Nrbf:
| Package | Downloads |
|---|---|
|
Microsoft.Build.Tasks.Core
This package contains the Microsoft.Build.Tasks assembly which implements the commonly used tasks of MSBuild. |
|
|
System.Resources.Extensions
Provides classes which read and write resources in a format that supports non-primitive objects. Commonly Used Types: System.Resources.Extensions.DeserializingResourceReader System.Resources.Extensions.PreserializedResourceWriter |
|
|
Microsoft.Build.Runtime
This package delivers a complete executable copy of MSBuild. Reference this package only if your application needs to load projects or execute in-process builds without requiring installation of MSBuild. Successfully evaluating projects using this package requires aggregating additional components (like the compilers) into an application directory. |
|
|
GreatUtilities.Infrastructure
Essencial tools to agile development. |
|
|
Krypton.Toolkit.Canary
An update to Component factory's krypton toolkit to support .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 11. This is the core toolkit module. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1 and .NET 8 - 11. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md To find out what's new, please visit: https://github.com/Krypton-Suite/Standard-Toolkit/blob/canary/Documents/Changelog/Changelog.md This package is for those who want to try out the latest features before deployment. |
Showing the top 13 popular GitHub repositories that depend on System.Formats.Nrbf:
| Repository | Stars |
|---|---|
|
dotnet/wpf
WPF is a .NET Core UI framework for building Windows desktop applications.
|
|
|
yaobiao131/downkyicore
哔哩下载姬(跨平台版)downkyi,哔哩哔哩网站视频下载工具,支持批量下载,支持8K、HDR、杜比视界,提供工具箱(音视频提取、去水印等)。
|
|
|
dotnet/winforms
Windows Forms is a .NET UI framework for building Windows desktop applications.
|
|
|
GitTools/GitVersion
From git log to SemVer in no time
|
|
|
ashmind/SharpLab
.NET language playground
|
|
|
emgucv/emgucv
Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library.
|
|
|
Abdelrhman-AK/WinPaletter
Advanced Windows Appearance Editor
|
|
|
ImAiiR/QobuzDownloaderX
QBDLX is a program that downloads streams directly from Qobuz
|
|
|
vers-one/EpubReader
.NET library for reading EPUB files
|
|
|
SnapHutaoRemasteringProject/Snap.Hutao.Remastered
实用的开源多功能原神工具箱 🧰 / Multifunctional Open-source Genshin Impact Toolkit 🧰
|
|
|
bolorundurowb/Open-Exam-Suite
🎓 Open-source exam creator & simulator - design, build, and take computer-based practice tests. A free alternative to Visual CertExam Suite, built on .NET 10.
|
|
|
elgarf/vMixUTC
Customizable controller for vMix
|
|
|
wangdage12/Snap.Hutao
「新」稳定版胡桃工具箱
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.5.26302.115 | 196 | 6/9/2026 |
| 11.0.0-preview.4.26230.115 | 619 | 5/12/2026 |
| 11.0.0-preview.3.26207.106 | 695 | 4/14/2026 |
| 11.0.0-preview.2.26159.112 | 1,587 | 3/10/2026 |
| 11.0.0-preview.1.26104.118 | 742 | 2/10/2026 |
| 10.0.9 | 35,538 | 6/9/2026 |
| 10.0.8 | 133,473 | 5/12/2026 |
| 10.0.7 | 182,499 | 4/21/2026 |
| 10.0.6 | 63,412 | 4/14/2026 |
| 10.0.5 | 305,285 | 3/12/2026 |
| 10.0.4 | 36,762 | 3/10/2026 |
| 10.0.3 | 322,864 | 2/10/2026 |
| 10.0.2 | 531,107 | 1/13/2026 |
| 10.0.1 | 768,118 | 12/9/2025 |
| 9.0.17 | 991 | 6/9/2026 |
| 9.0.16 | 4,945 | 5/12/2026 |
| 9.0.15 | 98,371 | 4/14/2026 |
| 9.0.14 | 11,383 | 3/10/2026 |
| 9.0.13 | 13,970 | 2/10/2026 |
| 9.0.12 | 14,202 | 1/13/2026 |