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

How do you enumerate MetaType's members?

I'm using protobuf-net v2 (r480) and I have a MetaType class where some members have been added via the Add() method. I'd like to enumerate them (get a collection of ValueMember objects), but it seems that despite having a by-index indexer, MetaType…
Allon Guralnek
  • 15,813
  • 6
  • 60
  • 93
1
vote
5 answers

protobuf datetimeoffset

Just wanted to share an observation about the R561 version of protobuf-net. When using DateTimeOffSet, an exception InvalidOperationException (No serializer defined for type: System.DateTimeOffset) appears: I added a method with a getProto() and…
AxelF
  • 109
  • 3
  • 15
1
vote
1 answer

protobuf-net: inheritance in C# but not in wire-format

I get that protobuf do not support inheritance, and since I am using protoc-c on another end, I do not want to use any extensions as well. However, I am stuck with a C# model that depends on inheritance: class Header { public int version { get;…
Phuah Yee Keat
  • 1,572
  • 1
  • 17
  • 17
1
vote
1 answer

ProtoContractAttribute with Inherited = false

Here's a scenario: [ProtoContract] class A{} A while later another dev adds: class B : A { int m; } I have a fallback to XML if a class doesn't have ProtoContractAttribute or had errors during Google Protocol Buffers serialization. The problem…
Oron Nadiv
  • 225
  • 2
  • 11
1
vote
1 answer

Protobuf-Net Extention methods keeps throwing exception

I created a sample application in VS2010 with .Net 4 setting. I am trying out the ProtoBuf-Net Extention methods. However, Whenever, I try to call GetValue extention, It throws an exception saying Method or operation is not implemented StackTrace: …
SysAdmin
  • 5,455
  • 8
  • 33
  • 34
1
vote
2 answers

How to use protobuf-net to serialize a byte array?

Is it possible to serialize a byte array using protobuf-net and then send it over a socket for de-serializing client side? I'm looking for an efficient way to compress/reduce the data which is sent. Somebody told me protobuf-net would be the best…
Joey Morani
  • 25,431
  • 32
  • 84
  • 131
1
vote
1 answer

Protobuf-net “a reference-tracked object changed reference during deserializartion” error (2)

Risking to violate etiquette (my apologies if that is improper), I like to bump this question because it has been floating around for a while without a single answer. I believe this is actually a more serious bug as part of the Protobuf-net library…
Matt
  • 7,004
  • 11
  • 71
  • 117
1
vote
0 answers

protobuf-net deserialize fails on collections

Below is the class definitions that work and dont' work in a WCF environment running protobuf-net version 2.0.0.480. Know that the processing code populates the response's list with the real type in hand, in this case SomeClassRow. And the more…
Ninos
  • 224
  • 4
  • 18
1
vote
1 answer

Reference tracking fails for a complex scenario

Using R556, reference tracking for the following complex scenario fails, see the assertion in the test. Using a shim class instead of a surrogate for the custom collection does not change the issue. Apparently SO doesn't like my description so maybe…
user1546077
  • 157
  • 8
1
vote
1 answer

Exception serializing custom collection

Thanks for the great library Marc and for all the answers on SO. I'm using protobuf-net r480.zip on .NET 4.0.zip from http://code.google.com/p/protobuf-net/downloads/list. Is this the latest stable release? I'm having trouble serializing a custom…
user1546077
  • 157
  • 8
1
vote
1 answer

Cloning a RuntimeTypeModel to unfrozen state?

is it possible to access an exist serialization model from defined model and then append a Contracted but unknown subtype to it, subsequently use it for serialization ? or do i need to explicitly create a new model ? i.e. in this case for…
kalki
  • 516
  • 2
  • 10
1
vote
1 answer

For protobuf-net, are there any circumstances under which DeserializeWithLengthPrefix can throw an exception?

I am making an app with protobuf-net, using it for sending/receiving data over the network. I am curious whether/how someone can send something that will make this line throw an exception: var message =…
ikh
  • 2,336
  • 2
  • 19
  • 28
1
vote
1 answer

protobuf-net and an empty property in subclass

I was trying to use protobuf-net and faced with the following problem. I have two classes. [ProtoContract] class parent { [ProtoMember(1)] public string name { get; set; } } [ProtoContract] class child : parent { [ProtoMember(2)] …
Teddy Bo
  • 679
  • 8
  • 19
1
vote
1 answer

protobuf.net Handling of Nullable

How can i serialize Nullable types with protobuf.net? This post tries to explain a few approaches: Can I serialize arbitrary types with protobuf-net? The problem is that there seems to be a bug with the surrogate approach in relation to Nullable,…
hjalet
  • 13
  • 2
1
vote
1 answer

Proto-Buf.Net and serialization

I've a problem with serializing an object using protobuf.net. I've used it on other classes and it works very well, but using this it doesn't. Could you help me saying why. Thanks. I want to use protobuf because BinaryFormatter is very slow in…
Mapo
  • 115
  • 1
  • 11
1 2 3
99
100