我们可以使用Protobuf-net来序列化ImmutableArray <t>吗?

时间:2017-01-19 17:44:58

标签: c# protobuf-net

我正在尝试使用System.Collections.ImmutableArray<byte>序列化一个类的protobuf-net v 2.0.0.668成员。

根据Marc博客上的以下文章,自r-666以来支持这一点:http://blog.marcgravell.com/2013/09/fun-with-immutable-collections.html

但是,在反序列化对象时出现异常:

System.NullReferenceException: Object reference not set to an instance of an object 
at System.Collections.Immutable.ImmutableArray`1[T].get_Length () [0x00000] in <36486b016d234fca8cd67892bf29c7b5>:0

当我使用System.Collections.ImmutableList<T>代替System.Collections.ImmutableArray<T>

时,(de)序列化有效

这是预期的吗?我建议改用ImmutableList吗?

0 个答案:

没有答案
相关问题