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\";
Message
Try this...
public static bool IsQueueAvailable(string queueName)
{
var queue = new MessageQueue(queueName);
try
{
queue.Peek(new TimeSpan(0, 0, 5));
return true;
}
catch (MessageQueueException ex)
{
return ex.Message.StartsWith("Timeout");
}
}
If the queue doesn't exist or if the account running the app doesn't have sufficient rights to get to it, the exception message clearly states so.
AND, this would work with both FormatName and the usual queue path.