A contract-based Protocol Buffers serializer for .NET with idiomatic API patterns similar to XmlSerializer.
protobuf-net is a contract-based serializer for .NET that implements Google's Protocol Buffers serialization format. It allows .NET developers to serialize and deserialize objects efficiently using compact binary encoding while providing an API that follows typical .NET patterns similar to XmlSerializer and DataContractSerializer.
.NET developers who need efficient binary serialization for data exchange, microservices communication, or persistent storage, particularly those working with Protocol Buffers or gRPC services.
Developers choose protobuf-net because it combines the performance and compactness of Protocol Buffers with a familiar .NET API, eliminating the need to learn Google's native C++-style API while maintaining full compatibility with the Protocol Buffers specification.
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.
The serializer follows patterns similar to XmlSerializer and DataContractSerializer, making it intuitive for developers already accustomed to .NET serialization frameworks, as highlighted in the README.
Leverages Google's Protocol Buffers format for compact data storage and fast serialization/deserialization, reducing overhead in data exchange scenarios like microservices.
Allows clear declaration of type hierarchies using [ProtoInclude] attributes, enabling serialization of polymorphic objects without implicit assumptions.
Supports configuration via RuntimeTypeModel in addition to attributes, providing alternatives for dynamic or code-first scenarios beyond static decoration.
Every serializable class and member must be annotated with [ProtoContract] and [ProtoMember], which can clutter code and require modifications to existing models, adding maintenance overhead.
Developers must assign and maintain unique integer IDs for each member, increasing the risk of errors during schema evolution or refactoring, as noted in the README's identifier notes.
While .proto file support exists via protogen, the primary workflow is attribute-based, which may not seamlessly align with schema-first teams preferring Google's native toolchain.