protobuf-net Serializing System.Object With DynamicType Throws Exception

后端 未结 1 1802
半阙折子戏
半阙折子戏 2021-01-19 16:19

In my application, I\'m serializing messages to send over the wire using protobuf-net. Each message has a list of key-value pairs for header information.

However, I

相关标签:
1条回答
  • 2021-01-19 16:51

    The current implementation of Dynamic type does not support primitives. It only supports contract types (other classes which have are somehow defined as ProtoContract).

    From the wiki:

    DynamicType - stores additional Type information with the type (by default it includes the AssemblyQualifiedName, although this can be controlled by the user). This makes it possible to serialize weak models, i.e. where object is used for property members, however currently this is limited to contract types (not primitives), and does not work for types with inheritance (these limitations may be removed at a later time). Like with AsReference, this uses a very different layout format

    0 讨论(0)
提交回复
热议问题