Reputation: 1170
this dataserializer is great for performance. but I keep getting stuck on datacolumns that has datatype of System.Object causing the serializer to throw an exception:Cannot serialize data column of type 'System.Object'.
is there any way around it?
Upvotes: 1
Views: 403
Reputation: 1063884
The protobuf format is designed to suit scenarios where the data is predictable to the receiver, and does not suit "object" scenarios very well, however, depending on the data layout a few things are possible:
I can illustrate either if I understand the model more.
Upvotes: 2
Reputation: 181057
From the protobuf-net getting started page
Unlike XmlSerializer, the member-names are not encoded in the data - instead, you must pick an integer to identify each member.
In other words, you need to help the serializer by defining on each and every class how to serialize and deserialize it. If it is really a requirement to be able to automatically serialize all classes based on System.Object, protobuf is not for you.
Upvotes: 0