title: Testing Whether a Remote MessageQueue Exists (using C#)
body: <p>How can I tell whether a remote message queue <a href="http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.exists.aspx%0A" rel="noreferrer">exists</a>?  The documentation states that the "Exists" method does not work for remote machines.</p>
  
  <p>The following is not valid (I know the queue path is accurate since I am able to send messages to the queue):</p>
  
  <pre>
  if (!MessageQueue.Exists(@"FormatName:Direct=TCP:192.168.2.58\Private$\MyQueue"))
    throw new InvalidOperationException("Queue does not exist");
  </pre>
  
  <p>The problem is that sending a message to a network address that does not have a listening queue behind it does not cause an exception.  Having an exception thrown for an invalid queue address is critical to our application.</p>