Easier way to debug a Windows service

后端 未结 28 1933
春和景丽
春和景丽 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:08

    For trouble-shooting on existing Windows Service program, use 'Debugger.Break()' as other guys suggested.

    For new Windows Service program, I would suggest using James Michael Hare's method http://geekswithblogs.net/BlackRabbitCoder/archive/2011/03/01/c-toolbox-debug-able-self-installable-windows-service-template-redux.aspx

提交回复
热议问题