protobuf-net

Calling WCF service w/ ProtoBehavior and multiple parameters

This one has me puzzled and am hoping it's a silly oversight on my part. When I call the following web service, if a null parameter is encountered then all following parameters are null (or zero for the numerics). [OperationContract, ProtoBehavior] [ServiceKnownType(typeof(ServiceFault))] [FaultContract(typeof(ServiceFault))] PersonPro...

C++ equivalent to SerializeWithLengthPrefix

I built a communication library using Protocol Buffers (protobuf-net) using Sockets (TcpListener and TcpClient) and it is working fine, but now a co-worker needs to write a library to communicate with my software using C++. Turns out that I'm using the Serializer.NonGeneric.SerializeWithLengthPrefix and Serializer.NonGeneric.TryDeserial...

ProtoInclude for fields ?

I have a simple object [ProtoContract] public class DataChangedEventArgs<T> : EventArgs { private readonly object key; private readonly T data; private readonly DataChangeType changeType; ///<summary> /// Key to identify the data item ///</summary> public object Key { get { return key; } } ...

Deserialization fail after switching PrefixStyle to Fixed32

I have a test suite for a communication library I'm developing using protobuf-net that is running okay. All tests pass. But if I change the PrefixStyle from Base128 to Fixed32, the deserialization fail. The exception I receive from the TryDeserializeWithLengthPrefix function is: System.ArgumentNullException was caught Message="Value...

Error while using ProtoBuf-Net with flags enum.

While using ProtoBuf-Net and serializing an enum property, where the enum is set to [FlagsAttribute], I received the following error message when serializing an enum value composed of multiple flags. The error is: The value (MyEnum.MyValue) has no wire-representation for property MyProperty Where MyEnum is: [Flags] public Enum MyEnum ...

Why is my WCF server returning empty responses using protobuf-net ?

I've updated an existing WCF application to add protobuf-net support. Basically, I've : added protobuf-net.dll (.net 3.0) as a reference in the assembly containing all my data objects. This assembly is referenced by both my server and my client replaced [DataMember] by [DataMember(Order = x)] (using increasing ints as x) Updated all my...

protocol buffers .net (protobuf-net) 10x slower that xml serializer. how come?

the title says it all. i noticed that serialization as well des deserialization takes 10x as lang with protobuf-net compared to XmlSerializer. the output files however are much smaller. i find this confusing because protobuf is such a simple format that should run very fast. any hints on how to speed it are greatly appreciated. Edit: h...

How does protobuf-net achieve respectable performance?

I want to understand why the protocol buffers solution for .NET developed by Marc Gravell is as fast as it is. I can understand how the original Google solution achieved its performance: it pre-generates optimized code for object serialization; I've written some serialization by hand and know that it is possible to write pretty fast co...

protobuf-net: Incorrect wire-type deserializing TimeSpan

I get this exception when my client application is trying to deserialize a message comming from WCF service ("Incorrect wire-type deserializing TimeSpan"). I'm using .NET 3.5 SP1 and latest version of protobuf-net (1.0.0.275). I have no idea what could be the issue comming from. I don't undersand the reason of this error message. Anyo...

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? ...

DataContract serialization with protobuf-net r275

I just updated to r275 version and it doesn't seem to manage correctly DataContract classes any more By serializing this very simple class: [DataContract] public class ProtoData { [DataMember(Order = 1)] private long _id; [DataMember(Order = 2)] private string _firstName; [DataMember(Order = 3)] private string _...

Serializing a List of objects using Protobuf-net

I've been looking to do some binary serialization to file and protobuf-net seems like a well-performing alternative. I'm a bit stuck in getting started though. Since I want to decouple the definition of the classes from the actual serialization I'm not using attributes but opting to go with .proto files, I've got the structure for the ob...

protobuf-net communicating with C++

I'm looking at protobuf-net for implementing various messaging formats, and I particularly like the contract-based approach as I don't have to mess with the proto compiler. one thing I couldn't quite find information on is, does this make it difficult to work cross-platform? there are a few C++ apps that would need to be able to parse PB...

Using Protobuf-net, I suddenly got an exception about an unknown wire-type

(this is a re-post of a question that I saw in my RSS, but which was deleted by the OP. I've re-added it because I've seen this question asked several times in different places; wiki for "good form") Suddenly, I receive a ProtoException when deserializing and the message is: unknown wire-type 6 What is a wire-type? What are the differ...

Is it possible to use ProtoBuf-Net with ISerializable mechanism?

We have a project which uses serialization by implementing ISerializable and using BinaryFormatter. We are moving to .net compact which do not have BinaryFormatter class. I was wondering if we can use ProtoBuf-Net. Can we instruct ProtoBuf-Net to use GetObjectData() for serialization? Specifically, I want to find out how to use Serialize...

How to use protobuf-net extensions??

I have created a .proto file and the ProtoBufTool successfully created .cs file. I am kinda new to csharp and I am trying to set the extension fields. But not sure how to do it? Does anybody have any examples how to use extensions using protobuf-net. My .proto file: package messages; message DMsg { optional int32 msgtype = 1; ...

Mismatched group tags detected in message - protobuf-net

I’m quite new to Silverlight. I’m working for a project which mainly depends on Serialization and Deserialization. Formerly, for WPF I was comfortable with Serializable classes. For silverlight, I found protobuf would be quite useful. But, I'm troubled with this exception. I don't know what causes this problem. Please help me out. I'm...

protobuf-net [de]serializing across assembly boundaries

I have a base class in one assembly and a large number of generated classes in another that inherit from the base class. Using protobuf-net (r282) to serialize a list of the base type fails when attempting to resolve the subclassType (line 248 of SerializerT.cs) because the subclass is not in the assembly of the base class. Moving the cl...

WCF hosting in .NET compact framework

I would like to host a service on a WinCE device. The WinCE device is the host which can be accessed(control and data acquisition) by multiple clients (PC or WinCE) over serial port, TCP, USB etc. I was considering using Protocol Buffers for serialization on the wire. It would be ideal to use WCF or remoting but as far as I see they are ...

Protocol Buffers c# (protobuf-net) Message::ByteSize

I am looking for the protobuf-net equivalent to the C++ API Message::ByteSize to find out the serialized message length in bytes. ...