Ok my issue is similar to How to receive message from a private workgroup queue (and I am basically using the same code).
I am creating the queue on the host machine using
MessageQueue.Create(@".\Private$\MyNewPrivateQueue");
Opening the queue on the remote machine with
var queue = new MessageQueue(@"FormatName:DIRECT=TCP:xxx.xxx.xxx.xxx\PRIVATE$\MyNewPrivateQueue");
And writing/reading data using queue.send() and queue.Receive()
I have two systems that I am experimenting with.
- Windows 7 Home Premium x64
- Windows XP SP3
When I create the private queue on the W7 system and try to write then read the queue from the XP system (as per the referenced question) it fails with a "Message Queue Service is not available" exception on the read action.
However, when I reverse the systems (create the queue on the XP system and write/read from the W7 system, and using the same code) it works as expected.
I have worked through:
- Reading Messages from Remote Queues
- Understanding how MSMQ security blocks RPC traffic
- Getting MSMQ messages out of Windows Server 2008 remotely
- Clear the way - MSMQ coming through
- MSMQ 3.0 too secure for you?
I have also tried turning off the W7 and XP firewalls, and given every man and his dog full permissions on the queues themselves to no avail.
Given that it works with XP as the queue host but not with W7 as the host I assume that it s a security issue and not a code issue. But for the life of me I cannot see where in W7 the blockage is.
EDIT 8/9
OK .. adding
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters\Security\AllowNonauthenticatedRPC
Allowed me to read messages from the remote private queue. However this does not seem to allow the use of
GetPrivateQueueByMachine(String machineName)
to enumerate the available private queues. So any ideas for this one?