1、打开服务设计界面,右键选择“添加安装程序”
选中serviceProcessInstaller1->右键属性->Account选择LocalSystem
安装windows服务:
(1)输入cd C:\Windows\Microsoft.NET\Framework\v4.0.30319,然后回车
(2)然后输入 InstallUtil.exe D:\TestService\bin\Debug\Service1.exe,回车即可
卸载服务:
InstallUtil.exe Service1.exe /u