WCF Distributed Development common errors (19)

Source: Internet
Author: User

WCF Distributed development Common error (D): There was a error opening the queue open message Queue error

An error occurred while debugging the managed hosting WCF MSMQ Message Queuing code:

There was a error opening the queue. Ensure that MSMQ are installed and running, the queue exists and has proper to being read from. The inner exception may contain additional information.

There is an error opening the queue to ensure that MSMQ is installed or running, that the queue exists and has read permissions. An exception may contain additional information inside.

Solution:

NetMsmqBinding queBinding = new NetMsmqBinding(NetMsmqSecurityMode.None);
                 queBinding.ExactlyOnce = false;
                 queBinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;

                 // 添加服务终结点

                 host.AddServiceEndpoint(typeof(WCFService.IWCFMSMQService), queBinding, queBaseAddress);

                 //判断是否以及打开连接,如果尚未打开,就打开侦听端口
                 if (host.State !=CommunicationState.Opening)
                 host.Open();

Attention:

1. NetMsmqBinding quebinding = new NetMsmqBinding (netmsmqsecuritymode.none), message no Safe mode;

2. Quebinding.exactlyonce = false; The property with the binding message read only once is set to false;

3. Use host. AddServiceEndpoint (typeof (Wcfservice.iwcfmsmqservice), quebinding, quebaseaddress);

Add Endpoints.

Note that the settings in the configuration file are logged off, only using code to set, and finally starting the host.

Reference articles:

http://social.msdn.microsoft.com/forums/en-US/wcf/thread/7ceeb231-2ff4-4431-9d61-dc071b916788

The foreigner also encounters this problem, the discussion is also more, but I changed the safe mode to solve out.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.