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
9
votes
2 answers

ProtoBuf-net serializing IEnumerable

I'm trying to use ProtoBuf-NET in my project (it's mostly Silverlight 4 project). I'm having difficulties serializing my Model collections, they all are defined like this: private List _itemsSet; public IEnumerable TSet { get {return…
Alex Burtsev
  • 12,418
  • 8
  • 60
  • 87
9
votes
1 answer

protobuf-net message serialized size property

We are using protobuf-net for serialization and deserialization of messages in an application whose public protocol is based on Google Protocol Buffers. The library is excellent and covers our all requirements except for this one: we need to find…
Boris Mesetovic
  • 420
  • 4
  • 9
9
votes
1 answer

Batching technique using Protobufs

Is there an efficient technique to batch different Protobuf events while sending over HTTP? The goal is to have a list of multi-type Protobuf messages in one request. One idea I have is to separate messages in small arrays and specify their type to…
gorros
  • 1,411
  • 1
  • 18
  • 29
9
votes
1 answer

Using ProtoBuf-Net, how to (de)serialize a multi-dimensional array?

Since ProtoBuf-Net does not support serializing/deserializing multi-dimensional arrays, how would I go about managing my arrays?
Stécy
  • 11,951
  • 16
  • 64
  • 89
9
votes
3 answers

Protobuf-net object reference deserialization using Dictionary: A reference-tracked object changed reference during deserialization

I'm having some issues trying to serialize/deserialize a complex object graph using protobuf-net. I'm working on a legacy application and we're using .Net Remoting to connect a GUI client to a C# service. We are seeing poor performance with overseas…
Lee F
  • 569
  • 5
  • 11
9
votes
3 answers

ProtoBuf.NET not serializing when using DataContract attributes

I'm using the latest version of ProtoBuf on NuGet (2.0.0.480) and it does not serialize types marked with DataContract/DataMember attributes: [DataContract] public class Person { [DataMember] public string Firstname { get; set; } } class…
Ben Foster
  • 34,340
  • 40
  • 176
  • 285
9
votes
2 answers

Memory usage serializing chunked byte arrays with Protobuf-net

In our application we have some data structures which amongst other things contain a chunked list of bytes (currently exposed as a List). We chunk bytes up because if we allow the byte arrays to be put on the large object heap then over…
James Thurley
  • 2,650
  • 26
  • 38
9
votes
6 answers

XML vs Binary performance for Serialization/Deserialization

I'm working on a compact framework application and need to boost performance. The app currently works offline by serializing objects to XML and storing them in a database. Using a profiling tool I could see this was quite a big overhead, slowing the…
Charlie
  • 10,227
  • 10
  • 51
  • 92
8
votes
3 answers

protobuf and List - how to serialize / deserialize?
I have a List with different types of objects in it like integers, strings, and custom types. All custom types are protobuf-adjusted. What I wanna do now is to serialize / deserialize this list with protobuf.net. Up until now I suspect that…
matambo
8
votes
1 answer

Force protobuf-net to ignore IEnumerable/ICollection interfaces

How can I get v2 of protobuf-net to ignore the fact that my class implements ICollection, IEnumerable, etc? For this particular scenario, I only want the fields I have flagged as [ProtoMember] to be serialized. I am currently in the process of…
Amanduh
  • 1,233
  • 1
  • 13
  • 23
8
votes
1 answer

Reference integrity in BinaryFormatter

The existence of AsReference option in Protobuf-net and the word that BinaryFormatter is a "graph serializer" lead me to assume that BinaryFormatter does not maintain references and that it makes a copy of every object. But I did some tests and…
Jake
  • 11,273
  • 21
  • 90
  • 147
8
votes
4 answers

Protobuf.net Exception - Timeout while inspecting metadata

I am sometimes receiving the following exception when attempting to deserialise an object using protobuf.net. I'm surprised as I never have more than a single thread deserialising the same object at the same time and the protobuf.net source does not…
MarcF
  • 3,169
  • 2
  • 30
  • 57
8
votes
1 answer

Protobuf-Net ProtoMember "IsRequired" attribute usage

What is the usage for the Protobuf-Net ProtoMember "IsRequired" attribute? What effect will it have if I add a new property (member) to an already serialized class in a file. If I use "IsRequired=true" will it just accept it without loading a value…
Eliseo
  • 1,547
  • 1
  • 15
  • 14
8
votes
1 answer

serializing a Dictionary in ProtoBuf-net fails

(NOTE: Dictionary where T is some ProtoContract / ProtoMembered class works fine. ) This issue only happened for me with type object. I was trying to serialize a dictionary of Dictionary working. typeof(object) doesn't work. Should it? Should…
sgtz
  • 8,849
  • 9
  • 51
  • 91
8
votes
1 answer

Adding custom ValueProviderFactories to ASP.NET MVC3?

I was looking to try and add a Protobuf ValueProviderFactory to MVC3 so that I could pick out the MIME type and deserialize the raw data into objects for action parameters. I could also use this to change the default Json serializer. Looking at…
Tim
  • 7,746
  • 3
  • 49
  • 83