This documentation is archived and is not being maintained.

BinaryMessageEncodingBindingElement.MaxSessionSize Property

Gets or sets the maximum amount of memory available within a session for optimizing transmission procedures.

Namespace: System.ServiceModel.Channels
Assembly: System.ServiceModel (in system.servicemodel.dll)

public int MaxSessionSize { get; set; }
/** @property */
public int get_MaxSessionSize ()

/** @property */
public void set_MaxSessionSize (int value)

public function get MaxSessionSize () : int

public function set MaxSessionSize (value : int)

Not applicable.

Property Value

The maximum size, in bytes, of a session. The default value is 2048 bytes.

Exception typeCondition


The value is less than or equal to zero.

The .NET Binary Format for XML can optimize the transmission of strings when they are used in multiple messages within a session. Once a string is sent in a message, additional messages that contain that string can refer to it using only the string's ID. This requires that the strings and their IDs be stored in memory. This allows the ID to be retransmitted in subsequent messages instead of the entire string. This lookup increases the efficiency of message transmission when using the binary format. The MaxSessionSize gets and sets the maximum amount of memory that is allocated to store these strings.

be.MaxSessionSize = 2048;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0