方法一:
1、编译windows服务项目工程
2、把服务注册到系统服务上
3、在visual studio 编辑器中,打断点,用 Debug 进程调试
方法二:
在Onstart 方法中,加上 Debugger.Launch();