MessagePropertyFilter.DefaultExtensionSize Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the size, in bytes, of the default extension buffer.

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

public int DefaultExtensionSize { get; set; }

Property Value

Type: System.Int32

The default extension buffer size to create when the message is received. The default is 255 bytes.

Exception Condition

The assigned value is negative.

The default extension size specifies the number of bytes to allocate for the message's extension. The Extension property of the Message class represents the additional, application-defined information associated with the message, such as a binary large object. It is the responsibility of the application to interpret the contents of the Extension.

The following code example demonstrates the use of the DefaultExtensionSize property.

// Set the filter's DefaultExtensionSize property to 1024 bytes.
queue.MessageReadPropertyFilter.DefaultExtensionSize = 1024;

// Display the new value of the filter's DefaultExtensionSize property.
Console.WriteLine("MessageReadPropertyFilter.DefaultExtensionSize: {0}",

.NET Framework
Available since 1.1
Return to top