Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Reserializing object throws ArgumentException #118

Open
ArcadeMode opened this issue Feb 10, 2020 · 0 comments
Open

Reserializing object throws ArgumentException #118

ArcadeMode opened this issue Feb 10, 2020 · 0 comments

Comments

@ArcadeMode
Copy link

Hi! I have started experimenting with ZeroFormatter and I am running into the following issue:

When I serialize an object (to network) and read+deserialize on the other end everything works fine. The proxy class from ZeroFormatter returns correct values etc. However, during testing I found out that when re-serializing on the receiving-end (not even modifying the values in the object) it throws an exception:

System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
   at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
   at ZeroFormatter.ZeroFormatterSerializer.CustomSerializer`1.Serialize[T](Stream stream, T obj)

I managed to reproduce this issue with both dynamic union and non-dynamic union objects, also in a unit test environment, so its not the network messing things up here..

I hope this project is still somewhat active (I see 3 years since last changes) and someone can help me get around this issue.
The program I am building is currently running on Net Core 2.1, the class I am serializing is nothing more than a string,string key-value pair (implemented in custom class with all required attributes)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant