开发者

How to efficiently write code and debug windows service project in visual studio?

How to efficiently write code and debug windows service project in visual studio? Visual Studio gives

Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.

when I want to debug my code. It seems to me that it is inefficient to test the code. One has to install a service, start it, attach the debugger, t开发者_Python百科est it, and then uninstall it.

Thanks, Gil.


As the first comment mentioned there are many other items out there...but I wanted to put a little light on this as well.

  1. You can use a post build event to manage the process of installing after build etc, so that you don't have any effort needed there.
  2. You can use Debugger.Break() to be able to start debugging right away. This way you are not playing the "Attach" game.

These will at least get you going, and help reduce the "pain" you experience.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜