Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while serializing dictionary #80

Open
MisterSokol opened this issue May 15, 2024 · 0 comments
Open

Error while serializing dictionary #80

MisterSokol opened this issue May 15, 2024 · 0 comments

Comments

@MisterSokol
Copy link

MisterSokol commented May 15, 2024

Hi,

There is a problem with serialization and deserialization of dictionaries.

I want to serialize with the Serializer created like this

new NetSerializer.Serializer(new [] { typeof(Dictionary<string, object>) });

but I'm getting an error System.Collections.Generic.KeyNotFoundException: 'Type not found System.Double'

When I add to the serialized types typeof(double) it works for now but then fails on deserialization.

Deserialization with only typeof(Dictionary<string, object>) gives error: System.NullReferenceException in NetSerializer.Serializer.GetDeserializeTrampolineFromId method
And deserializing with typeof(Dictionary<string, object>) and typeof(double) finishes without error but... The deserialized data is trash. Just a single double number instead of dictionary. And the stream position is 4 (didn't went to the end)

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

No branches or pull requests

1 participant