我们有一个Windows服务,它使用WCF从MSMQ队列中读取消息。最近,该服务无法启动,因为它无法打开队列:
Running WcfHost, service contract IWcfService. :
System.InvalidOperationException: 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. --->
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)
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.MsmqVerifier.VerifyReceiver(MsmqReceiveParameters receiveParameters, Uri listenUri)
at System.ServiceModel.Channels.MsmqTransportBindingElement.BuildChannelListener[TChannel](BindingContext context)
at System.ServiceModel.Channels.Binding.BuildChannelListener[TChannel](Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, BindingParameterCollection parameters)
at System.ServiceModel.Description.DispatcherBuilder.MaybeCreateListener(Boolean actuallyCreate, Type[] supportedChannels, Binding binding, BindingParameterCollection parameters, Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, ServiceThrottle throttle, IChannelListener& result, Boolean supportContextSession)
at System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff, ServiceHostBase serviceHost, Uri listenUri, ListenUriMode listenUriMode, Boolean supportContextSession, IChannelListener& result)
at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
at System.ServiceModel.ServiceHostBase.InitializeRuntime()
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at WcfHost`2.Open()
我们已经仔细检查了队列的权限,但没有更改。我们运行ProcMon并且没有看到任何拒绝访问的事件。我们不知道改变了什么导致了这个错误。
为什么WCF无法打开此队列?
答案 0 :(得分:0)
您可以尝试从队列设置中关闭RPC请求吗?