Replies: 1 comment 2 replies
-
|
I never recommend anyone use the Contractless+AllowPrivate resolver, since that means properties tend to be serialized twice (via the property and its backing field). I'm not familiar with Xrm at all. I can say we don't actively support that, but your creative attempts will probably get you to a working place sooner or later. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Im using vsstreamjsonrpc for IPC (using named pipes as the underlying transport)
The system is very nice I have to say.
However I have a usecase im curious about to solve in a nice way.
I need to send objects from microsoft xrm through pipe. (like Entity or even lists of entityreferences and even derived objects...)
Currently for simplicity and getting the RPC thing going, we just serialized some objects / those entities ourself with a DataContractSerializer so the rpc system just needs to serialize the string and we have full control about de and serialization.
However im curious if Its possible to have messagepack configured as streamjson rpc formatter and have it utilize the DataContract Attributes set by microsoft to automagically serialize and deserialize these xrm entities
I tried that and it get this exception:
"InnerException":"{"UserMessage":"Error writing JSON RPC Message: MessagePackSerializationException: Failed to serialize Microsoft.Xrm.Sdk.Metadata.EntityMetadata value.","UserErrorCode":"77000000","Message":"Error writing JSON RPC Message: MessagePackSerializationException: Failed to serialize Microsoft.Xrm.Sdk.Metadata.EntityMetadata value.
I have the RPC formatter configured like this:
the remark from the messagepack docs suggests its not supported.
However, it is not supported by the analyzers nor source generator. Also, features like UnionAttribute, MessagePackFormatter, SerializationConstructor, etc can not be used. Due to this, we recommend that you use the specific MessagePack for C# annotations when possible.
I just want to clarify if this really does not work and if there is something better I can do than to serialize/deserialize the objects myself and give only primitives to the system.
Beta Was this translation helpful? Give feedback.
All reactions