views:

20

answers:

1

I have a build server with many builds for web sites and web services. I'm doing some new code using WCF; my new code runs as a Windows Service.

Ordinarily, when I make changes to a web site, I "check out" the files I need to edit from TFS, make the changes, "check in" the files, and then perform a build. At this point, my new code is up and running on my development build server. Finally, the code is branched to my staging and production servers.

How do I configure a build to deploy my WCF service in this manner? My concern is that I cannot simply deploy the Windows Service and write over the old copy because the service must be stopped first and then restarted. How do I do this?

+1  A: 

You can add a set of exec tasks to your build script (*.*proj file) to stop the service before you overwrite it.

See the NET STOP command for stopping a service: http://technet.microsoft.com/en-us/library/bb490715.aspx

Jim Lamb