I get the exception when executing the following code. Any ideas what is wrong?
string queueName = "FormatName:Direct=TCP:1.1.1.1\\Private$\\test";
MessageQueue queue;
if (MessageQueue.Exists(queueName))
queue = new System.Messaging.MessageQueue(queueName);
else
queue = MessageQueue.Create(queueName);
queue.Send(sWriter.ToString());
Edit:
Here is the exception message and first line of stacktrace
Cannot determine whether a queue with the specified format name exists.
at System.Messaging.MessageQueue.Exists(String path)
It works for a local queue by the way.