Closed arnoldsi-vii closed 2 years ago
@jodydonetti After some checking it's probably TypeNameHandling = TypeNameHandling.All
creating the issue due the nature of FusionCacheDistributedEntry
.
Hi @arnoldsi-vii , the exception seems to indicate that you tried to serialize and deserialize a piece of data using 2 different types. In particular it says these 2 types:
FusionCacheDistributedEntry<Object>
FusionCacheDistributedEntry<IEnumerable<infra.Models.Notification>>
Personally I tend to not include type name and similar when serializing, because then you may have problems later on when deserializing, in case you've done some refactoring.
For example let's you saved a piece of data in the distributed cache with a certain type name, then you change the type name (via refactoring) and then try to deserialize it -> error.
So what I tend to do is try to include less type information in the distributed cache, and be specific when deserializing by specifying the type I want back.
After some checking it's probably
TypeNameHandling = TypeNameHandling.All
creating the issue due the nature of FusionCacheDistributedEntry.
Great, I hope this is solved! Let me know if there's something else I can help you with.
Hi, The more we use the library, the more we love it, but there is odd issue happens from time to time:
This is the entry:
This is the configuration:
We use In Memory and Redis with .net6