Export (0) Print
Expand All

BinaryMessageFormatter.Read Method

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

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

public Object Read(
	Message message
)

Parameters

message
Type: System.Messaging.Message

The Message, in binary format, to deserialize.

Return Value

Type: System.Object
The deserialized message.

Implements

IMessageFormatter.Read(Message)

ExceptionCondition
InvalidOperationException

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

ArgumentNullException

The message parameter is null.

Security noteSecurity Note

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

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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft