相关疑难解决方法(0)

ProtoBuf.net序列化派生类时不包括基类属性

使用最新的2.0 beta版ProtoBuf.net我试图序列化派生类(只是示例),我得到空文件.为什么基类属性没有序列化?

[ProtoContract]
[Serializable]
public class Web2PdfClient : Web2PdfEntity
{

}

[ProtoContract]
[Serializable]
public class Web2PdfEntity : EngineEntity
{

    [ProtoMember(1)]
    public string Title { get; set; }
    [ProtoMember(2)]
    public string CUrl { get; set; }
    [ProtoMember(3)]
    public string FileName { get; set; }

}


[ProtoContract]
[Serializable]
public class EngineEntity
{

    public bool Result { get; set; }
    public string ErrorMessage { get; set; }
    public bool IsMembershipActive { get; set; }
    public int ConversionTimeout { get; set; }
    public byte[] …
Run Code Online (Sandbox Code Playgroud)

.net c# class protobuf-net

4
推荐指数
1
解决办法
3281
查看次数

标签 统计

.net ×1

c# ×1

class ×1

protobuf-net ×1