Edit

Share via


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
Public Function Read (message As Message) As Object

Parameters

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.

The message parameter is null.

Remarks

Important

Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see Validate All Inputs.

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