I have below 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 the object of above class using protobuf.net.While serializing getting an error "No suitable Default Type encoding found." please suggest me what i need to do for this? Below is my code for serilization:-
MemoryStream ms = new MemoryStream();
var srariazeObj = new StateValueWrapper();
srariazeObj.StateValueType = typeof(int);
srariazeObj.WrappedObj = 5;
ProtoBuf.Serializer.NonGeneric.Serialize(ms, srariazeObj);