【发布时间】:2015-09-09 09:09:40
【问题描述】:
我正在尝试使用 protobuf 序列化 ConcurrentQueue,但在反序列化对象时出现异常
Type is not expected, and no contract can be inferred: System.Collections.Concurrent.ConcurrentQueue`1[[System.Byte[], mscorlib
有办法解决吗?喜欢为 Protobuf 编写扩展或继承和扩展 ConcurrentQueue?
【问题讨论】:
-
为什么需要序列化并发队列?将项目出列并使用
List<T>或数组。您可以在反序列化后重新填充实际队列。
标签: c# .net serialization protocol-buffers protobuf-net