我使用C#代码创建了一个Windows服务,它已安装并显示在服务管理面板中。我想删除它。
这是我在VS 2012开发人员命令提示符中的命令。
c:\source\MessagingPlatform\2013Q4\MessagingCFE\ServiceHost\bin\Debug>installuti
l /u ServiceHost.exe
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.17929
Copyright (C) Microsoft Corporation. All rights reserved.
The uninstall is beginning.
See the contents of the log file for the c:\source\MessagingPlatform\2013Q4\Mess
agingCFE\ServiceHost\bin\Debug\ServiceHost.exe assembly's progress.
The file is located at c:\source\MessagingPlatform\2013Q4\MessagingCFE\ServiceHo
st\bin\Debug\ServiceHost.InstallLog.
Uninstalling assembly 'c:\source\MessagingPlatform\2013Q4\MessagingCFE\ServiceHo
st\bin\Debug\ServiceHost.exe'.
Affected parameters are:
logtoconsole =
logfile = c:\source\MessagingPlatform\2013Q4\MessagingCFE\ServiceHost\bin\Deb
ug\ServiceHost.InstallLog
assemblypath = c:\source\MessagingPlatform\2013Q4\MessagingCFE\ServiceHost\bi
n\Debug\ServiceHost.exe
No public installers with the RunInstallerAttribute.Yes attribute could be found
in the c:\source\MessagingPlatform\2013Q4\MessagingCFE\ServiceHost\bin\Debug\Se
rviceHost.exe assembly.
The uninstall has completed.
c:\source\MessagingPlatform\2013Q4\MessagingCFE\ServiceHost\bin\Debug>
但是当我刷新服务管理面板时,服务仍在那里。
这意味着根本没有被删除。谢谢你的建议。
答案 0 :(得分:0)
使用sc命令行实用程序:
sc delete <servicename>
请务必在此处使用实际服务名称,而不是显示名称。
但是,有时无需重新启动即可删除服务。它被标记为“禁用”。