Skip to main content
protobuf-net package icon

protobuf-net

v3.4.40Latest Stable
.NETFramework4.6.2net8.0.NETStandard2.0.NETStandard2.1

Provides simple access to fast and efficient "Protocol Buffers" serialization from .NET applications

Published
Oct 21, 2026
28d ago
Total Downloads
293.2M
293,168,585

Install

dotnet add package protobuf-net --version 3.4.40
ProductVersions
.NET
net8.0
.NET Standard
netstandard2.0netstandard2.1
Other
.NETFramework4.6.2

README

protobuf-net

A contract-based serializer for .NET that reads and writes Google's "protocol buffers" wire format. The API follows normal .NET patterns — broadly comparable to XmlSerializer or DataContractSerializer — so you annotate the types you already have:

[ProtoContract]
public class Person
{
    [ProtoMember(1)] public int Id { get; set; }
    [ProtoMember(2)] public string Name { get; set; }
}

using var file = File.Create("person.bin");
Serializer.Serialize(file, new Person { Id = 12345, Name = "Fred" });

Members are identified on the wire by number, not by name, so the numbers matter: pick them once and keep them stable. Everything the attributes do can also be configured at runtime, via RuntimeTypeModel.

Contract-first works too: generate C#/VB from a .proto schema at build time, from the command line with protobuf-net.Protogen, or in your browser at protobuf-net.dev.

Build tools — analyzers that check your contracts, and the generator that emits serializers at compile time so native AOT and trimming work — ship with this package by default; opt out with <ProtoBufDisableBuildTools>true</ProtoBufDisableBuildTools>.

More

Changes from Previous Version

v3.4.30v3.4.40
Added Dependencies

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.

Related Guides & Workflows

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