Switches for Windows Services

Brian Noyes just posted up about adding a –c switch to Windows Service applications (actually he was talking specifically about self hosted WCF services). I completely agree that this is a good practice, you would be surprised how many times I see developers doing crazy stuff like commenting lines of code in and out as they alternate between their debug and release code.

I’d like to add a few things to the list of recommended command line arguments for Windows Service executables:

/install <username> <password>

/uninstall

/help

As a practice I also recommend always adding a ConsoleTraceListener to the list of listeners at start-up of the executable (in code, not via configuration). I spend a fair bit of my time looking at the deployment challenges related to software development and getting this right significantly helps the deployment process.

5 thoughts on “Switches for Windows Services

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s