How do I debug Windows services in Visual Studio?

后端 未结 17 743
梦毁少年i
梦毁少年i 2020-11-28 03:56

Is it possible to debug the Windows services in Visual Studio?

I used code like

System.Diagnostics.Debugger.Break();

but it is givi

17条回答
  •  情歌与酒
    2020-11-28 04:12

    You should separate out all the code that will do stuff from the service project into a separate project, and then make a test application that you can run and debug normally.

    The service project would be just the shell needed to implement the service part of it.

提交回复
热议问题