Skip to the content.

Super early and experimental. This is research, published so people can try it, not a product. Expect every API here to change or vanish, and nothing to be supported. It does work, within the narrow limits listed below, and is tested against protobuf-net on every build.

protobuf-net.Zero is Protocol Buffers serialization for C# compiled with no runtime at all: no base class library, no garbage collector, no exceptions, no reflection. It is in the spirit of bflat’s --stdlib:zero and zerosharp: a whole program that serializes protobuf is a native exe of under 20 KB, importing a handful of kernel32 functions.

It shares protobuf-net’s attribute model: you annotate a struct with [ProtoContract] and [ProtoMember], and a source generator writes the serializer at compile time. The bytes match protobuf-net’s exactly.

protobuf-net.Zero on NuGet protobuf-net.Zero.Sdk on NuGet

Two ways to use it

Pages

Current limits

These are the important ones. Each is a property of the research so far, not a design decision.

Source and feedback

github.com/protobuf-net/protobuf-net.Zero. The research notes, recording what it took and what went wrong, are in notes/findings.md.

For protobuf-net itself, see docs.protobuf-net.dev.