Serializes an object into the body of the message.
Assembly: System.Messaging (in System.Messaging.dll)
- Type: System.Messaging.Message
- Type: System.Object
The object to be serialized into the message body.
The top object format and type format need not be specified to write to the queue as they must be when reading. The TopObjectFormat and TypeFormat properties are used by the formatter only when deserializing a message.
The BinaryMessageFormatter can serialize most objects, but the result is not loosely coupled. However, it is compact, so the formatter is efficient for large objects.