asp.net - .Net 自定义服务无法启动
问题描述
我创建了一个自定义 Windows 服务,并尝试通过命令提示符启动它:
C:\Windows\system32>net START "CustomService"
The CustomService service is starting.
The CustomService service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.
我尝试查看 HELPMSG 3534。它指出:服务未报告错误。我不知道从这里去哪里。我试着用谷歌搜索这个,但没有什么真正有用的。我真的不知道如何解决这个问题。
Protected Overrides Sub OnStart(ByVal args() As String)
SetConfigVariables()
_logger.WriteMessageToLog(SimpleLog.LogType.InfoType, "Start Service")
End Sub
SetConfigVariables() 调用 sql server 并提取一些数据并设置适当的全局变量。
解决方案
问:你得到这个工作了吗?
建议:
如果没有,请确保您已完成本文中的所有操作,尤其是:
在运行 Windows 服务之前,您需要安装它,这会将其注册到服务控制管理器
还:
问:这个问题的情况如何:Accessing Config File From Web - No AppSettings
推荐阅读
- javascript - 如何限制异步任务,直到循环中没有工作?
- generics - ForEach 中的内容不应该符合 View
- express - 如何使用相同的路线,一条带参数,一条不带?
- html - 如何在没有背景“故障”的情况下添加 HTML 按钮?
- c# - 实体框架错误:已经有一个打开的 DataReader 与此命令关联
- tkinter - 我正在用 Python 创建一个 gui 程序,但作业没有运行
- azure - 用于对用户进行身份验证的 Azure 应用程序
- java - 在 java 中使用 aws lambda 将记录分批放入 kinesis firehose
- css - @keyframes 动画在 Safari(macOS、iOS)上不起作用
- flutter - Flutter 中的 Clean Architecture 在哪里执行状态更改?