Skip to content

BinaryFormatter persistent version conflict #109

@CezarCretu

Description

@CezarCretu

When using CacheManager with redis, the default serialization method is BinaryFormatter.
Binary formatter includes the versioned assembly name into its binary output (see here).

Due to this, if you cache some non-primitive value referenced in an assembly, and then change that assembly's version, CacheManager won't be able to solve version conflicts on its own.

From my understanding of the code, on update it pulls the old value and deserializes it, which works fine. Then the output gets serialized again for comparison with the value stored in cache, and this is where the problem arises.
Since the version is included in the BinaryFormatter output, the comparison will always fail since the binary array will never be the same.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions