Basically, returning object
is going to be a huge problem for any serializer that isn't BinaryFormatter
or NetDataContractSerializer
; returning object
just doesn't work and is inappropriate on a general purpose WCF boundary. protobuf-net, in common with most serializers (including DataContractSerializer
, XmlSerializer
, JSON.NET, etc) wants to know more than just object
; simply, that is not enough information to deserialize in most scenarios.
As long as you return object
, that just isn't going to work well with protobuf-net (or, as noted, most serializers). At the moment, ProtoOperationBehavior
inherits from DataContractSerializerOperationBehavior
; one possible option would be to write a version of this that defaults to NetDataContractSerializer
rather than DataContractSerializer
- this would mean that unknown types would be serialized by NetDataContractSerializer
instead; of course, it still wouldn't use protobuf-net for object
, because it can't.