-
Notifications
You must be signed in to change notification settings - Fork 24
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
MessagePack Serialization Fails #42
Comments
Hi GammaSoul, MessagePack is difficult to implement, because you have to decorate every type that is serialized with attributes ([MessagePackObject] and [Key]) or provide other metadata. CoreRemoting has some internal classes that describe messages. This classes are serialized using the plugged in serializer. Because this classes are not decorated with MessagePack stuff, serialization fails. |
Maybe it's achievable using https://github.com/ModernRonin/MessagePack.Attributeless library. Will definitely require creating a separate package, say, Attributeless library allows to list serializable types and properties externally, without attributes. graph
CoreRemoting.Serialization.MessagePack --> CoreRemoting
CoreRemoting.Serialization.MessagePack --> MessagePack
CoreRemoting.Serialization.MessagePack --> MessagePack.Attributeless
MessagePack.Attributeless --> MessagePack
Not sure if it worth the effort though :) |
Serialization is still an issue. With .NET 9 the old BinaryFormatter will be cut off by default. Only special properties in project file will reactive unsupported usage. Attributeless MessagePack moves the attributes outside to an external structure, like the builder in EF Core. MessagePack may be interessting as separate package for special use cases. My current approach is to pimp Json.NET BSON/JSON serialization with custom converters (e.g. for DataTables / DataSet). |
That's sad... I've seen a couple of alternative binary serializers that don't require attributes.
I believe attributeless mode can be mixed with normal message pack attributes. So that CoreRemoting classes are registered using the fluent builder (to avoid the dependency).
The downside of BSON/JSON (afaik) is that they don't handle circular references and duplicates. |
MessagePack is not bad, but may be not the best choice as default serializer.
JSON.NET is able to preserve references. The behavior can be controlled via PreserveReferencesHandling setting. |
Of course not the default serializer, I agree.
Great! I was unaware of this. |
Yes, but other features like TypeNameHandling are currently not supported in System.Test.Json. You can find a detailed feature comparison here: |
Describe the bug
Hi there im having some trouble with your library
Using MessagePack (https://github.com/neuecc/MessagePack-CSharp) fails
The application hangs and then i get the error:
Error Wrong Credentials
Handshake with server failed.
Apart from the having to use the standard MessagePack resolver Serializer because there is some types of object to be serialized, it fails once that is resolved.
I need to serialize some types like NodaTime and others that MessagePack supports. Also MessagePack has the best performance.
Update:
When using the included Bson Serialization and i enclose my types in a data contract object then it works. does not work if the type is a raw method parameter.
So this is really just about supporting MessagePack for performance as i got Bson to work with my Types.
.
Thank you for having a look at this if you can 👍
The text was updated successfully, but these errors were encountered: