window services程序如何调试

详细说明见MSDN:
https://msdn.microsoft.com/en-us/library/7a50syb3(v=vs.110).aspx

  1. Build your service in the Debug configuration.
  2. Install your service. For more information, see How to: Install and Uninstall Services.
  3. Start your service, either from [Services Control Manager], [Server Explorer], or from code. For more information, see How to: Start Services.
  4. Start Visual Studio with administrative credentials so you can attach to system processes.
  5. (可选) On the Visual Studio menu bar, choose [Tools], [Options]. In the [Options] dialog box, choose [Debugging], [Symbols], select the [Microsoft Symbol Servers] check box, and then choose the OK button.
  6. On the menu bar, choose Attach to Process from the Debug or Tools menu. (Keyboard: Ctrl+Alt+P)
    The Processes dialog box appears.
  7. Select the [Show processes from all users] check box.
  8. In the [Available Processes] section, choose the process for your service, and then choose [Attach].
  9. Choose the appropriate options, and then choose OK to close the dialog box.
  10. Set any breakpoints you want to use in your code.
  11. Access the Services Control Manager and manipulate your service, sending stop, pause, and continue commands to hit your breakpoints. For more information about running the Services Control Manager, see How to: Start Services. Also, see Troubleshooting: Debugging Windows Services.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值