3

I have a web site and the user can search for something. The results are being saved in a session with MessagePackSerializer. Before each search, there is a try to load results from the session by calling MessagePackSerializer Unpack. From time to time, I change the object that is being saved in the session. When I publish this change to the web site - all the tries to load from the session are failing in the "Unpack" method.

The Exception:

System.Runtime.Serialization.SerializationException: Cannot deserialize member 'X' of type 'System.Int32'. ---> MsgPack.MessageTypeException: Cannot convert 'System.Int32' type value from type 'FixedRaw'(0xA1) in position 1,101. [8/26/2019 10:54:10 AM Informational] [xUnit.net 00:00:48.93] at MsgPack.MessagePackStreamUnpacker.ThrowTypeException(Type type, ReadValueResult header) [8/26/2019 10:54:10 AM Informational] [xUnit.net 00:00:48.93] at MsgPack.MessagePackStreamUnpacker.ReadInt32Slow(ReadValueResult header, Byte[] buffer, Int64& offset, Int32& result)

Is there a way to "Unpack" although there are missing objects in the deserialized object?

I tried to look for answers on the net and I tried to desirialize the object to "object" and then to cast it back to the original class - but it still fails.

Iñigo
  • 1,877
  • 7
  • 25
  • 55

0 Answers0