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
7
votes
1 answer

ProtoBuf-Net error message - "Nested or jagged lists and arrays are not supported"

The main objective is to dynamically populated the Dictionary Object and serialize it using the Protobuf-net and send it across the WCF service to the client side. @marc Can you please tell me a code sample as to how can I resolve the error "Nested…
Ram
  • 147
  • 3
  • 11
7
votes
1 answer

Can I use net.tcp bindings for protobuf-net WCF?

Can I use net.tcp bindings for protobuf-net WCF? Can I use ClientBase or I have to use ProtoClient?
Rohit
  • 3,610
  • 7
  • 45
  • 76
7
votes
2 answers

How does protobuf-net handle readonly fields?

I use protobuf-net to serialize/deserialize my data. I have some rather simple classes, so that's no real problem. As far as I know, protobuf-net uses IL generation to create serialization/deserialization code. While I have readonly fields in my…
Piotr Zierhoffer
  • 5,005
  • 1
  • 38
  • 59
7
votes
2 answers

protobuf-net into .proto generates enum conflicts?

In C# we have namespaces in .proto we get from protobuf-net we do not get any namespaces. So the question is how to make protobuf-net generate (and use inside) .proto files with namespacs/packages. Example when we parsed all our project to make…
myWallJSON
  • 9,110
  • 22
  • 78
  • 149
7
votes
1 answer

Serialize prefix tree

I get a ProtoException ("Possible recursion detected (offset: 4 level(s)): o EOW") when serializing a tree structure like so: var tree = new PrefixTree(); tree.Add("racket".ToCharArray()); tree.Add("rambo".ToCharArray()); …
Marcus
  • 967
  • 10
  • 20
7
votes
2 answers

How to serialize arrays?

Symptom: No serializer defined for type: System.Array Since all C# arrays inherit from the Array class, I thought that this would be valid in ProtoBuf-net [ProtoMember(1)] public Array SomeKindOfArray = new int[]{1,2,3,4,5}; [ProtoMember(2)] public…
sgtz
  • 8,849
  • 9
  • 51
  • 91
6
votes
1 answer

protobuf-net OverwriteList on Byte Array

What I am doing is attempting to send an IPEndpoint through protobuf-net and what I observed is that when deserializing the array of 4 bytes into the IP4 address, the set code recieves a value of 8 bytes. Four bytes containing the orignal address,…
William Leader
  • 814
  • 6
  • 20
6
votes
1 answer

Using protobuf-net, is it possible to deserialize a message without allocating memory?

I have a C# application that needs to deserialize many thousands of protobuf messages per second. In the interest of avoiding unnecessary garbage collections, I'm wondering if there is a way to use pre-allocated memory so that each deserialization…
newdayrising
  • 3,762
  • 4
  • 27
  • 31
6
votes
2 answers

Protobuf.net Memory Usage

Heyup. Long time lover of protobuf.net. Quick question though. I have a highly multithreaded C# application which is deserialising perhaps 100 objects / second, amounting to about 50MB/sec. I am seeing very large memory usage, well over and above…
MarcF
  • 3,169
  • 2
  • 30
  • 57
6
votes
2 answers

Is DataMember(Order=n) annotation required for protobuf-net v2?

Simple experiment: I created an entity model from Northwind, and find that the generated classes don't work for protobuf-net v2 without adding the Order property. Is there a way to get the entity code generator to add Order, or is there a way to get…
P a u l
  • 7,805
  • 15
  • 59
  • 92
6
votes
1 answer

"An item with the same key has already been added" error with protobuf-net

I'm trying to replace an existing serializer with protobuf for C# by Marc Gravell. My code is extensive and my goal is to be able to do the switch with minimal changes. I came across an issue which I believe I understand why it happens but require…
yossic
  • 105
  • 1
  • 5
6
votes
0 answers

Protobuf-net [de]serialize GameObject (Unity 3D)

In Unity 3D, there is a GameObject with a Transform property. Transform has position (Vector3) and rotation (Quaternion). I would like to send these GameObjects to/from a backing store via protobuf-net. I am currently doing so with the following…
Chuck D
  • 1,629
  • 2
  • 16
  • 32
6
votes
2 answers

protobuf-net's [ProtoInclude(1, "MyClass")] did not work

I am using protobuf-net v2 beta r431 for C# .net 4.0 application. In my application I have a Dictionary which i need to serialize. A class MyClass implements IMyClass interface. As per protobuf's documentations I wrote the code as…
user386527
  • 125
  • 1
  • 5
6
votes
1 answer

Is of allowed in a run-time ProtoBuf-net model?

I am using version 2 of ProtoBuf-net, and currently I'm geting the error "Unable to determine member: A" Is it possible to create a run-time model for Protobuf-net when we use ClassOfType? If so, can anyone spot what I'm missing in the below…
sgtz
  • 8,849
  • 9
  • 51
  • 91
6
votes
1 answer

protobuf-net version 2.X to 3.X migration

I am doing an update of my protobuf-net library reference, specifically from 2.4.4 to 3.0.101. Previously, we used null in lists as they contain meaningful information to the business (e.g., new[] { "one", "two", null, null, "five" }). However,…
mike
  • 3,146
  • 5
  • 32
  • 46