rikimaru0345 / Ceras

Universal binary serializer for a wide variety of scenarios https://discord.gg/FGaCX4c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deserialize already serialized istance of class failed when i add field to class

StefanoAnversa opened this issue · comments

Good morning,

i have this problem.
I serialized a istance of my class "Area" and i save it on Redis Repository.
The "Area" class has a list of item WorkCenter
This is the old definition of "WorkCenter"

image

Now i edited the class and i add new field and added on Empy Constructor the default value of new field
image

Now when i try to deserialize istance saved on Redis with new definition (i use the deserialize method with generic type) i get this error:

"Index was out of range. Must be non-negative and less than the size of the collection. Arg_ParamName_Name"

Do you have any idea how I can fix this?

On this link: "https://github.com/rikimaru0345/Ceras/wiki/Optimization-&-Pitfalls" is written that "Ceras supports removing, renaming, and adding new fields (or properties), but changing the type of an existing member will not work. If you need that feature let me know and I'll add it".
So I expected that adding a field would have no problems but it isn't.