MSMQ :: GetPrivateQueuesByMachine does not work when using "localhost"

I have software running locally and on multiple servers that does the following:

var queues = MessageQueue.GetPrivateQueuesByMachine("localhost");

One server, in particular, throws an exception:

System.Messaging.MessageQueueException: Message Queue service is not available.
  at System.Messaging.MessageQueue.GetPrivateQueuesByMachine(String machineName)

MSMQ is installed the same way as on my other machines. I also have several WCF services successfully bound to net.msmq://localhost/private/....

Is there any reason why MSMQ cannot be bound to localhost?

After checking the MSDN, it seems that I should use ".", Which works fine, but I would prefer to avoid changing the code and redeploying when localhost seems completely efficient. FWIW, here are the results of some other tests that I performed:

var queues = MessageQueue.GetPrivateQueuesByMachine("."); // succeeds
var queues = MessageQueue.GetPrivateQueuesByMachine("localhost"); // fails
var queues = MessageQueue.GetPrivateQueuesByMachine("127.0.0.1"); // fails
var queues = MessageQueue.GetPrivateQueuesByMachine("machineName"); // fails
+5
1

, HOSTS, IP- localhosts .

+1

All Articles