Sunday, August 21, 2011

MSMQ, You Get "Invalid queue path name" Exception When Opening a Remote Private Queue

Example Symptom:
  • You have a remote computer named XYZZY
  • Inside it is a private queue named MyQueue
  • You have written the MSMQ code in C# (or .NET)
  • When accessing locally within XYZZY, you can use .\private$\MyQueue it works.
  • When trying to get to the queue using "XYZZY\private$\MyQueue from another computer even on the same subnet and no firewall enabled, you now get an MSMQ exception stating "Invalid Queue Path Name"
Try This:

Instead of

XYZZY\private$\MyQueue

Try this way.

FormatName:DIRECT=OS:XYZZY\private$\MyQueue

Note, spell FormatName exactly how it is. It is the only part that is case sensitive!

--
This was tested on Windows Server 2008 R2 with .NET 3.5

2 comments:

Nelson Giraldo said...

Hola, realice los pasos indicados pero me saca error en la linea siguiente: if (MessageQueue.Exists(queueName))

"No se puede determinar si existe una cola con el nombre de formato especificado"

Gracias.

Unknown said...

Lamento que no entiendo bien el español. Pero lo que es la cadena de nombre de cola está usando?