Send MSMQ message using C# without serialization?

T

Tbone

Is there any way to send a Message without having the .NET framework add the
"serialization" data to the body of the message? I am sending binary
structures in the message and I need full control over what is in the body
of the message. I see some extra bytes before and after the message I asked
the system to write. I am looking for a way to get rid of those so I can
send binary structures in messages to a C++ program and vice versa.

I am using the following code to send a message:
 
N

Nicholas Paldino [.NET/C# MVP]

Well, you can always have the C++ code deserialize the message through
the .NET framework and then access the object serialized on the message.

If you really must control all the bytes on the message, instead of
setting the Body property on the Message, you can set the BodyStream
property to a Stream that will contain the data to be sent.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top