Open asdfgasdfsafgsdfa opened 7 years ago
This is technical limitation in old days.
MsgPack for CLI internally uses IL generation (via System.Reflection.Emit
) and/or source code generation (via code DOM) to generate serializer code. Both of them require the target type is public.
Currently, it is possible when we use:
DynamicMethod
. As far as I know, msgpack for C# internally uses this technique, but this will take long time to implement.You can also use MessagePackMember attribute
Is there any reason why only public types can be serialized? The library should not decide what is allowed to be serialized and what not. Why create an artificial limitation like that?
If there any way to turn this off?
I want to use msgpack to save private datatypes in my application. And I also don't want to have my network messages public for everyone to see. It would be bad design to make those types public.