Questions tagged [protobuf-net]

An independent implementation of Google's protobuf binary serialization format, protobuf-net approaches the problem-space with common .NET coding styles, but retaining the high performance, dense output and cross-platform interoperability.

An independent implementation of Google's protobuf binary serialization format, protobuf-net approaches the problem-space with common .NET coding styles, but retaining the high performance, dense output and cross-platform interoperability. It's compatible with most of the .NET family, including .NET 2.0/3.0/3.5, .NET CF 2.0/3.5, Mono 2.x, Silverlight 2, etc.

In particular (compared to most implementations), it allows:

  • both code-first and contract-first development
  • mutable objects
  • inheritance

Oh, and it is pretty darned fast too.

Resources

1771 questions
6
votes
1 answer

Protobuf-net Object graph reference integrity

There's a neat option in protobuf-net ver 2 called [ProtoMember(2,AsReference=true)]. For the most part, this is a follow up question to: protobuf-net serializing object graph I started wondering if reference integrity is always maintained…
sgtz
  • 8,849
  • 9
  • 51
  • 91
6
votes
2 answers

How can I connect a gRPC client in .NET framework with a secure .NET Core server?

I'm using protobuf-net.Grpc on a .NET Core server and trying to make calls from a .NET Framework (4.7.2.) gRPC Client. A full example is here: https://github.com/angelagyang/GRPCProtobufExample Here is a snippet of my client: var channelCreds = new…
Angela Yang
  • 348
  • 3
  • 9
6
votes
1 answer

Serializing an IEnumerable trough WCF using Protobuf-net and Monotouch for IOS

I'm trying to code a WCF service on Monotouch/Monodevelop for IOS. I was using standard attributes like [DataMember]/[DataContract] for my serializable object and [ServiceContract]/[OperationContract] for my interface. Everything worked fine, but…
Jean-Philippe Leclerc
  • 6,713
  • 5
  • 43
  • 66
6
votes
3 answers

C# gRPC file streaming, original file smaller than the streamed one

I am having some problems with setting up a request-stream type gRPC architecture. The code below is just for testing purposes and it is missing various validation checks, but the main issue is that the original file is always smaller than the…
seesharper
  • 61
  • 1
  • 2
6
votes
1 answer

How to use IAsyncEnumerable within a message in protobuf-net.grpc?

So, recently I learned about how to do streaming with protobuf-net.grpc with the help of IAsyncEnumerable. This all works fine and dandy, but I'm facing a bit of an issue right now. For some of my calls, I'd like to call with both some metadata…
Sossenbinder
  • 4,852
  • 5
  • 35
  • 78
6
votes
4 answers

Protobuf-net Deserialize Open Street Maps

For the life of me I cannot deserialize the protobuf file from Open Street Maps. I am trying to deserialize the following extract: http://download.geofabrik.de/osm/north-america/us-northeast.osm.pbf to get Nodes and I am using…
jonperl
  • 871
  • 1
  • 10
  • 22
6
votes
2 answers

protobuf-net : how to represent DateTime in C#?

protogen.exe generates this pattern for a proto2 message field of type long : private long _Count = default(long); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"Count", DataFormat =…
BaltoStar
  • 8,165
  • 17
  • 59
  • 91
6
votes
0 answers

Sending Protobuf message to Web API Failing

I am using Microsoft Web API 2 and Protobuf-net to serialize my data. Everything is working perfectly, except when I want to send binary data to the Web API controller. I end up getting a 500 error. Is this currently possible or is this restricted…
user3726393
  • 265
  • 1
  • 2
  • 11
6
votes
1 answer

How to choose a field number when using protobuf-net inheritance?

I'm using protobuf-net for serializing a number of types, some of which are inherited from a base type. I know that the Protocol Buffers spec does not support inheritance, and that the support in protobuf-net is basically a workaround because of…
Steven Rands
  • 5,160
  • 3
  • 27
  • 56
6
votes
1 answer

Google Protocol Buffers - Fixed size buffer?

Using Google Protocol Buffers, can I set a maximum size for all messages I encode? if I know that what I encode is never larger than X bytes, then Google Protobuffs would always produce a buffer of size Y, and if I give it a smaller amount of data,…
Roey
  • 391
  • 1
  • 8
  • 14
6
votes
1 answer

Protobuf-Net serialize object with unaccessible to proto type

Suppose I have a following class: public class Test { int x { get; set; } int y { get; set; } Vector3 coords { get; set; } } How can I serialize this object if I canont use [ProtoContract] and [ProtoMember(x)] attributess on Vector3 class,…
GuardianX
  • 515
  • 11
  • 29
6
votes
2 answers

Deserialize list of objects using protobuf

I'm building a C# server and python client app with socket communication. The server sends serialized list of objects to client, but I've got no idea (and couldn't find either) how to deserialize a list in python. Any help would be appreciated.
Davita
  • 8,928
  • 14
  • 67
  • 119
6
votes
1 answer

protobuf-net keeping future fields

I've googled a bit for this now, but haven't been able to determine if protobuf-net or protobuf in general supports forward compatibility in the following sense: An older version of the object deserializes a new version of the object with a new…
Damian
  • 61
  • 1
6
votes
1 answer

Is there a way to define alternative conversion functions (from/to interfaces) in a protobuf-net surrogate class

Using protobuf-net v2 build 668, I’m trying to serialize/deserialize a class which contains a member defined as an interface while doing on-the-fly conversions at the same time. Normally, the surrogate approach would work just fine but since C#…
Franck Jeannin
  • 6,107
  • 3
  • 21
  • 33
6
votes
3 answers

protobuf-net documentation or alternatives

Protobuf-net seems to be the fastest and for high-performence needs most recommended serialization library for .NET. I really want to use it, as I need to send hundreds of thousands of objects over the wire. However, I'm having trouble getting…
Knack
  • 1,044
  • 2
  • 12
  • 25