Export (0) Print
Expand All

MessageQueue.BasePriority Property

Gets or sets the base priority Message Queuing uses to route a public queue's messages over the network.

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

public short BasePriority { get; set; }
/** @property */
public short get_BasePriority ()

/** @property */
public void set_BasePriority (short value)

public function get BasePriority () : short

public function set BasePriority (value : short)

Property Value

The single base priority for all messages sent to the (public) queue. The default is zero (0).

Exception typeCondition


The base priority was set to an invalid value.


An error occurred when accessing a Message Queuing method.

A message queue's base priority specifies how a message en route to that queue is treated as it travels through the network. You can set the BasePriority property to confer a higher or lower priority to all messages sent to the specified queue than those sent to other queues. Setting this property modifies the Message Queuing queue. Therefore, any other MessageQueue instances are affected by the change.

A message queue's BasePriority is not related to the Priority property of a message, which specifies the order in which an incoming message is placed in the queue.

BasePriority applies only to public queues whose paths are specified using the format name. The base priority of a private queue is always zero (0).

The following table shows whether this property is available in various Workgroup modes.

Workgroup mode


Local computer


Local computer and direct format name


Remote computer


Remote computer and direct format name


The following code example gets and sets the value of a message queue's BasePriority property.

// Set the queue's BasePriority property value.
queue.BasePriority = 10;

// Display the new value of the queue's BasePriority property.
Console.WriteLine("MessageQueue.BasePriority: {0}", queue.BasePriority);

// Set the queue's BasePriority property value.
// Display the new value of the queue's BasePriority property.
Console.WriteLine("MessageQueue.BasePriority: {0}", 

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Windows 98, Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions

© 2015 Microsoft