如何解压缩msgpack记录

时间:2019-11-13 08:26:56

标签: c# redis servicestack msgpack servicestack.redis

我正在使用Redis和C#。我将用户数据以msgPack格式保存在Redis中。如何反序列化msgPack数据?我想有些记录与Redis中的当前用户模型不同。当我尝试反序列化时,通常会得到序列化异常。我需要查看这些记录。有什么办法吗?

 var serializedValue = redisClient.Get(value.Key);
 if (serializedValue != null)
     value.Value = serializedValue.FromMsgPack<T>();
System.Runtime.Serialization.SerializationException: The unpacked value is not 'System.Int16' type. Do not convert System.Boolean (binary:0x0) MessagePackObject to System.Int16.
   at ServiceStack.MsgPack.MsgPackFormat.HandleException(Exception ex, Type type)
   at ServiceStack.MsgPack.MsgPackFormat.Deserialize(Type type, Stream fromStream)
   at ServiceStack.MsgPack.MsgPackExtensions.FromMsgPack[T](Byte[] bytes)

0 个答案:

没有答案