System.Messaging.MessageQueueException was unhandled : A workgroup installation computer does not support the operation.
If you play with MSMQ and get an exception like
System.Messaging.MessageQueueException was unhandled
Message=A workgroup installation computer does not support the operation.
at System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath(String queuePath, Boolean throwException)
at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
It might be due to a reason like mine.
var queues = MessageQueue.GetPrivateQueuesByMachine(“.”); var queue = queues.Where(q => q.QueueName == “private$\\mynewqueue”).Single(); var message = queue.Receive();
it does work
var queue = new MessageQueue(“private$\\mynewqueue”); var message = queue.Receive();
var queue = new MessageQueue(“.\\private$\\mynewqueue”); var message = queue.Receive();
and you might be good to go again.
I haven’t bothered to figure out exactly why but my workaround might help you.