Reputation: 4110
I create a queue on my local machine in some other process as follows:
MessageQueue.Create(@".\private$\sampleQueue");
And in my reader process, I attach to it as follows:
var queue = new MessageQueue(@".\private$\sampleQueue");
When I try to do queue.Peek()
, I get an access denied exception. I'm not on a domain, this is just my local workgroup computer. Any ideas?
Upvotes: 1
Views: 1328
Reputation: 4851
The credentials used by the process that creates the queue must be different from the credentials of the process used to read the queue. If that is the way it must be, then you will need to specifically grant the needed read permissions on the queue after you create it.
Upvotes: 2
Reputation: 4687
MSMQ uses different protocols for it's work:
If it is not a simple permissions issue (which it is very likely to be) then you need this blog post:
Understanding how MSMQ security blocks RPC traffic http://blogs.msdn.com/b/johnbreakwell/archive/2010/03/24/understanding-how-msmq-security-blocks-rpc-traffic.aspx
Cheers
John
Upvotes: 3
Reputation: 1745
If you r-click on the queue in Computer Management and select properties, do you have the appropriate permissions set on the Security tab?
Upvotes: 2