【发布时间】:2017-03-06 11:32:17
【问题描述】:
我有一个包含 topshelf 服务的项目,部署脚本会在服务器上卸载并重新安装较新的版本。
这在很长一段时间内都运行良好,直到上周由于未知原因开始出现异常。
现在发生的是命令:
D:/Deploy/current/net40/MyService.exe uninstall
打印出这些结果:
The uninstall is beginning.
2017-03-06T11:21:07 [1] INFO Topshelf.Runtime.Windows.HostInstaller - Uninstalling MyService service
Removing EventLog source MyService.
Service MyService is being removed from the system...
Service MyService was successfully removed from the system.
Attempt to stop service Halcyon.
The uninstall has completed.
但 MyService.exe 仍在 TaskManager 中运行。
结果
这个命令:
D:/Deploy/current/net40/MyService.exe install --manual
给出这个(预期的)错误:
ERROR Topshelf.Hosts.InstallHost - The MyService service is already installed.
我尝试将 Topshelf 更新到最新版本。 由于另一个奇怪的错误,在部署服务器上手动卸载和终止服务也不起作用。
Beginning the Install phase of the installation.
2017-03-06T11:40:08 [1] INFO Topshelf.Runtime.Windows.HostInstaller - Installing MyService service
Installing service MyService...
Service MyService has been successfully installed.
The Install phase completed successfully, and the Commit phase is beginning.
The Commit phase completed successfully.
The transacted install has completed.
INFO MyService.Program - Exiting Main() - exitCode:Ok
INFO Dozo::Applications::Topshelf - Starting MyService
INFO Dozo::Applications::Topshelf - Changing MyService to start automatically
INFO Dozo::Dozo - sc config "MyService" start= auto
[SC] ChangeServiceConfig SUCCESS
INFO Dozo::Applications::Topshelf - Starting MyService
INFO Dozo::Dozo - net start "MyService"
The MyService service is starting........
The MyService service could not be started.
我只是想不通为什么会这样。 我尝试添加更多错误日志,但没有任何结果。
以前有人吃过吗?任何想法如何让这个“粘性”服务在卸载后停止运行?
谢谢
【问题讨论】: