I have a class: -
[Serializable]
[DataContract(Name = "StateValueWrapper")]
public class StateValueWrapper
{
[DataMember(Order = 1)]
public Type StateValueType { get; set; }
[DataMember(Order = 2)]
public object WrappedObj { get; set; }
}
I am trying to serialize an object above a class using protobuf.net.While serializing the receipt of the error "There is no suitable encoding of the default type." please suggest me what do i need to do for this? Below is my serialization code: -
MemoryStream ms = new MemoryStream();
var srariazeObj = new StateValueWrapper();
srariazeObj.StateValueType = typeof(int);
srariazeObj.WrappedObj = 5;
ProtoBuf.Serializer.NonGeneric.Serialize(ms, srariazeObj);
source
share