title: C#, Deploying windows tasks and services after teamcity build
body: <p>We have a solution which consists of several projects. Some of the projects are windows tasks, some are windows services and some are mvc-websites which are running on a remote server. On this server we are currently implementing TeamCity as CI server for automating our builds and deployments. As of now, the projects are deployed on this same server. The build, test steps etc works fine but I am not sure how to deploy the tasks and services. All tutorials about this subject (at least those I have seen) only concerns deployment of websites.</p>
  
  <p>The most obvious way is to have a post-build step running a powershell script which are uninstalling the current running windows service, removes the old service, copy the new dll and start the service again. The windows task files could simply be replaced directly with the new version.</p>
  
  <p>However, I do not like this solution, it feels very blunt and could perhaps be hard to implement if the deployment server is remote.</p>
  
  <p>Does anyone have any better suggestion on how to make the deployment?</p>
  
  <p>Have a nice day!</p>