65.9K
CodeProject is changing. Read more.
Home

How to Debug or Test your Windows Service Without Installing it...

starIconstarIconstarIconstarIconstarIcon

5.00/5 (4 votes)

Oct 25, 2011

CPOL
viewsIcon

17330

I am writing a service at present and have written a few over the years. What I do now is put all the code in a separate DLL from the start off. My service methods Onstart, OnStop call into the DLL which starts a thread to do the work.For debugging, I have a separate test harness console app...

I am writing a service at present and have written a few over the years. What I do now is put all the code in a separate DLL from the start off. My service methods Onstart, OnStop call into the DLL which starts a thread to do the work.

For debugging, I have a separate test harness console app that calls into the same startup/stop function the service would. I make this console app my debug instance in the environment and away I go.

Not saying this is a better way than yours, just a different way.

Thanks.