为什么在 NServiceBus.Host.exe 中托管 NserviceBus 端点的 Windows 服务在没有为 exe 报告错误时无法启动? [英] Why does a windows service, hosting an NserviceBus endpoint in NServiceBus.Host.exe, fail to start when there are NO errors reported for the exe?

查看:46
本文介绍了为什么在 NServiceBus.Host.exe 中托管 NserviceBus 端点的 Windows 服务在没有为 exe 报告错误时无法启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要明确的是,托管服务没有错误,只是一般的 Windows 服务错误.

To be clear there are no Errors for the hosted service, just a generic Windows service error.

错误信息说:

错误 1053:服务没有及时响应启动或控制请求.

Error 1053: The service did not respond to the start or control request in a timely fashion.

如果我显式运行 NServiceBus.Host(安装 Windows 服务的地方),我会看到相关消息,指示端点成功启动",事实上,我可以看到订阅消息是持久化到一个相关的私有 MSMQ 队列中,然后 exe 坐下来等待,就像一个好的服务器应该有的那样,在它上面发生一些事情.

If I run NServiceBus.Host explicitly (where the windows service is installed) I am presented with relevant messages indicating a successful "spinning up" of the end point, and, in fact, I can see subscription message(s) are persisted into a relevant private MSMQ queue and the exe then sits and waits, like a good server should, for something to happen upon it.

如果我启动 Windows 服务(托管端点),则事件查看器中没有异常或事件,或者日志文件中的条目指示任何错误或让我有理由相信发生了不好的事情.如果我查看日志文件和队列,我可以看到订阅消息被指示为已调度,实际上,行为与独立运行相同,唯一的区别是服务不会启动.

If I start the windows service (hosting the endpoint) there are no exceptions or events in the event viewer, or entries in the log file to indicate any errors or give me reason to believe something bad is happening. If I look in the log file and queue I can see subscription messages are indicated as dispatched, in effect, the same behavior as running it standalone, with the only difference being that the service wont start.

Windows 服务由 NServiceBus 框架以通用主机的形式提供,因此各种所需的 Windows 服务方法的实现不是我可以控制的,如果您自己创建 Windows 服务,您通常会拥有这些方法.

The windows service is provided by the NServiceBus framework in the form of a generic host, and therefore implementation of the various required windows service methods is not something I have control of, which you would normally have if you were creating the windows service yourself.

推荐答案

我发现的最常见原因是日志记录.

The most common reason that I've found for this is down to logging.

运行该服务的用户帐户必须具有性能监控访问权限.

The user account running the service must have Performance Monitoring Access.

我通过 Server Manager > Users & 添加它组 > 组 > 性能日志用户 > 添加.

I add this through Server Manager > Users & Groups > Groups > Performance Log Users > Add.

这篇关于为什么在 NServiceBus.Host.exe 中托管 NserviceBus 端点的 Windows 服务在没有为 exe 报告错误时无法启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆