DeepClone /使用protobuf-net V3序列化列表<item>

问题描述

我们尝试将protobuf-net从V2升级到V3,并遇到一个问题,希望您能为我们指明正确的方向。 我们有一个包含元素列表的类:

[ProtoContract]
public class ClassToSerialize
{
    [ProtoMember(1)] public List<ListItem> List { get; set; } = new List<ListItem>();
}

当尝试创建DeepClone或进行序列化时,我们收到消息:

System.NotSupportedException:不支持嵌套或锯齿状的列表,数组和映射: System.Collections.Generic.List`1 [customizations.Test.IgnoreListHandlingTest + ListItem]

这在V2中有效,但在V3中无效。有什么方法可以序列化这种类型的类并恢复V2行为吗?

非常感谢您的提示。

可以在下面找到一个示例,该示例显示在V3中工作时在V3中哪种类型的序列化失败:Example

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)