2011-01-20 4 views
2

와 데이터 세트 직렬화 때 아래오류 protobuf - 순 나는 데이터 집합을 직렬화 protobuf - 그물을 사용하려고하지만, 아래의 오류가 무엇입니까

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()

코드를 사용하고

[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); 
    } 

답변

1

DataSet은 실제로 데이터 계약이 아니며 "v1"(사전 빌드 된 dll로 제공되는 코드)에는 지원되는 구현이 없습니다. 그러나 비교/의사 결정을위한 일련의 측정 항목을 포함하여 "v2"here에 관심이있을 수 있습니다.

관련 문제