BinaryMessageFormatter.Read(Message) BinaryMessageFormatter.Read(Message) BinaryMessageFormatter.Read(Message) Method

Definition

Reads the contents from the given message and creates an object that contains the deserialized message.

public:
 virtual System::Object ^ Read(System::Messaging::Message ^ message);
public object Read (System.Messaging.Message message);
abstract member Read : System.Messaging.Message -> obj
override this.Read : System.Messaging.Message -> obj

Parameters

message
Message Message Message

The Message, in binary format, to deserialize.

Returns

The deserialized message.

Implements

Exceptions

The message's BodyType property does not indicate a binary object.

Remarks

Important

Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see Data Validation.

The body of the message must be in binary format, and the same serializer must be used to deserialize the message as that which initially serialized it. If the body represents a custom class, the assembly for that class must exist locally.

Applies to

See also