C# 做的Windows 应用程序 服务

运行服务:

1,cmd下进入目录
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\
2,安装服务
installutil F:\中原集团\天津CCHR\trunk\cchr\trunk\CCOOBO\CCHR.WorkFlowReminderWathcer\bin\Debug\CCHR.WorkFlowReminderWathcer.exe
3,启动服务
net start WorkflowReminderWatchDog
4,卸载服务
installutil F:\中原集团\天津CCHR\trunk\cchr\trunk\CCOOBO\CCHR.WorkFlowReminderWathcer\bin\Debug\CCHR.WorkFlowReminderWathcer.exe -u

如果在启动服务时报错在下图位置查看

计算机-管理-系统工具-事件查看器-Windows 日志-应用程序

怎么调试程序:

调试-附件到进程

勾选 “显示左右用户的进程”--“显示所有会话中的进程”--“找到相关程序的exe文件”---最后点击附加

原文地址:https://www.cnblogs.com/gygtech/p/10002624.html