Skip to main content
 首页 » 编程设计

c#之如何手动删除Windows服务条目

2024年02月13日14langtianya

我试图实现 wcf 服务并将其托管在 Windows 服务上。那时我可以使用 installutil.exe 命令安装和卸载 wcf 服务。我错误地删除了项目,并且我的测试 wcf 服务安装在计算机中。现在我想手动删除该服务。任何想法?

当我尝试使用 Installutil.exe/u 路径 删除时它抛出异常

Exception occurred while initializing the installation: 
System.IO.FileNotFoundException: Could not load file or assembly 'XXX' or one of its dependencies. The system cannot find the file specified. 

我已经从我的服务properties -> path to executable 复制了路径。

请您参考如下方法:

使用

sc delete "servicename" 

在命令提示符下。