A contract-based Protocol Buffers serializer for .NET that follows idiomatic .NET patterns like XmlSerializer.
protobuf-net is a contract-based serializer for .NET that writes data in Google's Protocol Buffers format. It solves the need for efficient, cross-platform data serialization in .NET applications by providing a familiar API similar to `XmlSerializer` or `DataContractSerializer`, but with the performance and compactness of Protocol Buffers.
.NET developers building applications that require high-performance serialization for communication, storage, or RPC scenarios, especially those working in multi-language or cross-platform environments.
Developers choose protobuf-net because it combines the efficiency and interoperability of Protocol Buffers with an idiomatic .NET API, eliminating the steep learning curve of Google's native Protocol Buffers implementation while delivering excellent performance and small payload sizes.
Protocol Buffers library for idiomatic .NET
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Google's Protocol Buffers binary format for compact payloads and fast processing, ideal for high-throughput communication and storage, as noted in the README's emphasis on efficiency.
Mirrors patterns from XmlSerializer and DataContractSerializer with attributes like [ProtoContract], reducing the learning curve for .NET developers accustomed to built-in serializers.
Supports .NET 6.0+, .NET Standard, and .NET Framework 4.6.2+, ensuring wide applicability across different .NET environments, as listed in the 'Supported Runtimes' section.
Enables polymorphic serialization via explicit [ProtoInclude] attributes and includes protogen for generating .NET types from .proto files, offering flexibility for contract-based designs.
Requires careful assignment of unique integer identifiers to each member, and changing these breaks data compatibility, adding maintenance complexity, as warned in the 'Notes for Identifiers' section.
Inheritance and type contracts must be explicitly declared with attributes or runtime configuration, unlike some serializers that handle it automatically, which can be error-prone for dynamic hierarchies.
Relies on decorating classes with attributes or using RuntimeTypeModel, which may not suit projects favoring clean POCOs or dynamic type generation without modification.