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.
Source=System.Messaging
ErrorCode=-2147467259
StackTrace:
at System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath(String queuePath, Boolean throwException)
at System.Messaging.MessageQueue.get_FormatName()
at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
at System.Messaging.MessageQueue.Receive()
…
It might be due to a reason like mine.
With
var queues = MessageQueue.GetPrivateQueuesByMachine(“.”); var queue = queues.Where(q => q.QueueName == “private$\\mynewqueue”).Single(); var message = queue.Receive();
it does work
but with
var queue = new MessageQueue(“private$\\mynewqueue”); var message = queue.Receive();
it doesn’t.
Change to
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.