XDMessaging.Net
XDMessaging.Net copied to clipboard
Sending Custom Object
I am trying to send a Serialized custom object through a channel but in the MessageRecieved event the object is null. What is missing? I am using TypedDataGram<CustomObject> item = e.DataGram;.
Any help?
I had the same issue. It comes from the fact that the class reference is passed with the assembly info of the sender. So, if you simply have a copy of the class in both apps, the receiver will not be able to deserialize the object because it doesn't have access to the sender. Simply add the assembly of the sender(exe,dll) as a reference to the receiver, and remove the copy of the class in the receiver. With the reference to the original class, via the senders assembly, the receiver will build fine. And when it gets the inbound message it has the reference to the senders assembly to decode the message.