Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows services Msmq和WCF服务_Windows Services_Msmq_Wcf - Fatal编程技术网

Windows services Msmq和WCF服务

Windows services Msmq和WCF服务,windows-services,msmq,wcf,Windows Services,Msmq,Wcf,我已经使用NetMsmq绑定创建了一个WCF服务,我在我的机器上为其创建了一个专用队列并执行了该项目。这样就可以正常工作,我的WCF服务将启动,并在调试环境中使用队列访问消息。现在,我想使用windows服务托管该服务,并为此创建了一个新项目和windows installer(该服务在本地系统帐户下运行)。然后,我尝试通过命令提示符使用InstallUtil命令安装此windows服务。在安装过程中以及在服务主机打开期间,我会收到一个异常消息,消息是: There was an error o

我已经使用NetMsmq绑定创建了一个WCF服务,我在我的机器上为其创建了一个专用队列并执行了该项目。这样就可以正常工作,我的WCF服务将启动,并在调试环境中使用队列访问消息。现在,我想使用windows服务托管该服务,并为此创建了一个新项目和windows installer(该服务在本地系统帐户下运行)。然后,我尝试通过命令提示符使用InstallUtil命令安装此windows服务。在安装过程中以及在服务主机打开期间,我会收到一个异常消息,消息是:

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)

有人能为上述问题提出可能的解决方案吗?我是否缺少要为队列和windows服务设置的任何权限?如果是,请建议将这些权限添加到何处

是的,看起来像是权限问题

右键单击服务器管理器中的专用队列,然后选择属性。转到“安全”选项卡,并确保您在其中拥有本地系统帐户的正确权限


Nicholas Allen的文章也证实了这一点,作者将错误代码0xC00E0025定义为权限问题。

Tom Hollander有一个关于使用WCF MSMQ的三部分博客系列,非常值得一看


也许你会在某个地方找到你提到的问题的解决方案

我遇到了同样的问题,下面是解决方案


右键单击“我的电脑”-->管理。在计算机管理窗口中,转到“服务和应用程序-->消息队列-->ur队列”,选择ur队列并访问属性。添加运行ur WCF应用程序的用户并授予其完全访问权限。这应该可以解决问题。

很简单,服务找不到它的队列。 队列名称必须与端点地址完全匹配

例如:

净。msmq://localhost/private/wf.listener_srv/service.svc

指向本地队列

private$\wf.listener\u srv\service.svc


如果队列名称和端点彼此一致,则最类似于在
IIS池上定义的凭据不授予对队列的访问权。

。我已尝试为列表中的计算机帐户授予所有相关权限,如果该帐户被称为本地系统帐户。但我还是犯了同样的错误。已创建的专用队列的所有者为my domain login。我不知道我需要设置哪些权限。你能告诉我是否还有其他可能的许可缺失吗?Sowmya,你让它工作了吗?如果没有,请检查此链接