Je suis en train d'utiliser protobuf net pour sérialiser un ensemble de données, mais obtenir l'erreur ci-dessous:Erreur lors de jeu de données sérialisation avec protobuf-net
Unhandled Exception: System.InvalidOperationException: No suitable Default DataSet encoding found. at ProtoBuf.Serializer.ThrowNoEncoder(DataFormat format, Type valueType) at ProtoBuf.Property.PropertyFactory.CreateProperty[T](Type type, DataFormat& format, MemberSerializationOptions options)
at ProtoBuf.Property.PropertyFactory.Create[T](MemberInfo member) at ProtoBuf.Serializer`1.Build()
Voici le code utilisé
[ProtoContract]
public class Packet
{
[ProtoMember(1)]
public DataSet Data { get; set; }
[ProtoMember(2)]
public string Name { get; set; }
[ProtoMember(3)]
public string Description { get; set; }
}
using (var fs = new FileStream("test0.txt", FileMode.Create))
{
Serializer.Serialize(fs, packet);
Console.WriteLine("Total bytes with protobuf-net = " + fs.Length);
}