我正在尝试使用nssm服务管理器运行我的wpf服务。问题是,使用nssm我可以安装服务,但是当我尝试启动它时,我会在终端中得到以下响应:
MyService:响应启动控制的意外状态SERVICE_PAUSED。
然后,在EventViewer中,我得到以下错误:
无法启动
服务。服务进程无法连接到服务控制器。
虽然我可以使用网络命令启动我的服务,或者使用VisualStudio,但是这个问题只发生在nssm.
框架:.NET Framework 4.6.1
关于如何解决这个问题,有什么建议吗?
编辑1
我使用https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer示例创建了示例WPF服务。结果还是一样的。
编辑2
我设法获得了NSSM错误:
Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.我现在不明白nssm是怎么运作的..。
发布于 2020-02-03 11:17:12
我找到答案了!
我太笨了,没有意识到nssm是一个服务管理器,我试着用它运行一个windows服务.
我所要做的就是制作一个简单的控制台应用程序而不是服务.
发布于 2020-01-13 08:50:59
您可以尝试向bat文件发出网络命令。然后使用NSSM使bat文件服务。
https://stackoverflow.com/questions/58446853
复制相似问题