imperugo / StackExchange.Redis.Extensions

MIT License
607 stars 177 forks source link

MsgPack unable to deserialize C# DateOnly object #591

Open rbedellasmgroup opened 6 months ago

rbedellasmgroup commented 6 months ago

Describe the bug

MsgPack can serialize a C# DateOnly object, but it fails when deserializing. The error message is: Value cannot be null. (Parameter 'calendar')

To Reproduce

  1. Create a class with a DateOnly property
  2. Set the DateOnly property, like: EffectiveFrom = new DateOnly(2001, 1, 1)
  3. Store the msgpack serialized class in Redis
  4. Read from redis and deserialize with msgpack
  5. Deserialization fails on the previous step

Expected behavior Msgpack should deserialize C# DateOnly property correctly

Screenshots / StackTrace Deserialization fails when class contains a DateOnly property

image

Additional context This occurs on latest package version. StackExchange.Redis 2.7.33 StackExchange.Redis.Extensions.MsgPack 10.2.0

image