BinaryMessageFormatter.Read(Message) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.