Click here to Skip to main content
Click here to Skip to main content
Alternative Tip/Trick

Tagged as

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

, 25 Oct 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

KeithAMS
Software Developer
United Kingdom United Kingdom
No Biography provided

Comments and Discussions

 
GeneralThanks for your suggesion.... But i think this is more comp... PinmemberTejas_Vaishnav1-Nov-11 19:26 
GeneralRe: Thanks for your suggesion....But i think this is more comp... Pinmemberatamata24-Aug-12 7:03 
This is exactly what I do and not more complex at all. Actually it's simpler as it means your code is decoupled from the service process class meaning it is more easily integrated into automated testing.
GeneralRe: Thanks for your suggesion....But i think this is more comp... PinmemberStrange_Pirate28-Sep-12 3:20 
GeneralRe: Thanks for your suggesion....But i think this is more comp... PinmemberKeithAMS8-Oct-12 0:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141220.1 | Last Updated 25 Oct 2011
Article Copyright 2011 by KeithAMS
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid