一个 ASP.NET Core 6.0 的项目中 redis 客户端的序列化/反序列化组件用的是 MessagePack,日志中发现下面的发序列化错误:
MessagePack.MessagePackSerializationException: Failed to deserialize BlogPostStatsDto value.
---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at MessagePack.MessagePackReader.ThrowNotEnoughBytesException()
请问如何解决?
调用 MessagePack 进行反序列化的代码
MessagePackSerializer.Deserialize<T>(serializedObject, _options);