代码:
[ProtoMember(11002)]
public BigInteger StartInteger { get; private set; }
抛出异常:
No serializer defined for type: System.Numerics.BigInteger
如何使StartInteger
可序列化?
答案 0 :(得分:1)
通过执行以下操作来解决此问题:
public BigInteger StartInteger { get; private set; }
[ProtoMember(11002, DataFormat = DataFormat.FixedSize)]
private byte[] StartIntegerSerialized
{
get { return StartInteger.ToByteArray(); }
set { StartInteger = new BigInteger(value); }
}