Compartir a través de


Troubleshooting Exceptions: System.Messaging.MessageQueueException 

A MessageQueueException exception is thrown if a Microsoft Message Queuing internal error occurs.

Associated Tips

  • Check the MessageQueueErrorCode property of the exception to determine why the MessageQueue operation failed.
    Exceptions associated with the MessageQueueException class are generated by internal errors within Message Queueing that should be dealt with programmatically. Every exception consists of an error code and a text string that describes the source. For a list of these error codes and their descriptions, see MessageQueueErrorCode.

Remarks

If a MessageQueue opens a queue with the sharedModeDenyReceive parameter set to true, any MessageQueue that subsequently tries to read from the queue generates a MessageQueueException exception because of a sharing violation. The same exception is thrown if a MessageQueue tries to access the queue in exclusive mode while another MessageQueue already has nonexclusive access to the queue.

Visual Basic noteVisual Basic Note

MessageQueueTransaction is threading-apartment–aware. Visual Basic sets the state of the main thread to STA, so you must apply the MTAThreadAttribute in the Main subroutine. Otherwise, sending a transactional message using another thread throws a MessageQueueException exception.

See Also

Tasks

How to: Find Out More About an Exception with the Exception Assistant
How to: Create MessageQueue Component Instances

Reference

MessageQueueException