Msmq Service and WCF

I created the WCF service using the NetMsmq binding, for which I created a private queue on my machine and completed the project. This works fine as such, and my WCF service starts up and accesses the message using a queue in the debugging environment. Now I wanted to host the service using the Windows service, and for it I also created a new project and Windows installer (this service runs under the Local System account). Then I tried to install this Windows service using the InstallUtil command on the command line. When the installation occurs and during the opening of the service host, I get an exception:

There was an error opening the queue. Ensure that MSMQ is installed and running, the queue exists and has proper authorization to be read from. The inner exception may contain additional information. Inner Exception System.ServiceModel.MsmqException: An error occurred while opening the queue:Access is denied. (-1072824283, 0xc00e0025). The message cannot be sent or received from the queue. Ensure that MSMQ is installed and running. Also ensure that the queue is available to open with the required access mode and authorization. at System.ServiceModel.Channels.MsmqQueue.OpenQueue() at System.ServiceModel.Channels.MsmqQueue.GetHandle() at System.ServiceModel.Channels.MsmqQueue.SupportsAccessMode(String formatName, Int32 accessType, MsmqException& msmqException) 

Can anyone suggest a possible solution to the above problem? Are there any permissions for the queue, as well as Windows services, if you could suggest where these permissions should be added?

+7
wcf msmq windows-services
source share
4 answers

Tom Hollander had an excellent three-part blog series on using MSMQ from WCF - worth checking out!

You may find a solution to the problem mentioned somewhere!

+7
source share

Yes, this seems like a permission issue.

Right-click your private queue from Server Manager and select Properties. Go to the "Security" tab and make sure that you have rights to the local system account.

This is also confirmed in an article by Nicholas Allen: Diagnosing Common Queue Errors , where the author defines error code 0xC00E0025 as a permission problem.

+4
source share

I ran into the same problem, here is the solution.

Right-click My Computer β†’ Manage. In the "Computer Management" window, go to the "Services and Applications β†’" Message Queue "-> ur queue" section, select ur and access properties. Add the user running the WCF ur application and get full access. This should solve the problem.

+2
source share

It may just be that the service cannot find this queue. The queue name must exactly match the endpoint address.

Example:

net.msmq: //localhost/private/wf.listener_srv/service.svc

indicates a local queue

private $ \ wf.listener_srv \ service.svc

If the queue name and endpoint match, then it is most likely that the credentials defined in the IIS pool do not provide access to the queue.

0
source share

All Articles