Easier way to debug a Windows service

后端 未结 28 1624
春和景丽
春和景丽 2020-11-22 15:36

Is there an easier way to step through the code than to start the service through the Windows Service Control Manager and then attaching the debugger to the thread? It\'s ki

28条回答
  •  死守一世寂寞
    2020-11-22 16:20

    What I used to do was to have a command line switch which would start the program either as a service or as a regular application. Then, in my IDE I would set the switch so that I could step through my code.

    With some languages you can actually detect if it's running in an IDE, and perform this switch automatically.

    What language are you using?

提交回复
热议问题