Hello,
I'd like to have a script that stops a certain windows service,build or rebuild a solution and runs the service after the build process finished.
Should I use Msbuild for this ? Or is there any other way ?
Hello,
I'd like to have a script that stops a certain windows service,build or rebuild a solution and runs the service after the build process finished.
Should I use Msbuild for this ? Or is there any other way ?
You can use a batch file that will stop the service, build the solution then start the service:
net stop "service name"
<path to msbuild>\msbuild.exe <path to solution file>
net start "service name"
See how to start/stop services from the command line, and the msbuild command line reference.
Your other option, as mentioned is to use the MSBuild community tasks. There are many of them - ServiceController is the specific one for your need.
MSBuild is your answer. Controlling the services can be accomplished easily by using the Community Tasks, specifically the service controller task.
Is the service you are stopping the same executable you are building in the solution? If so, why not do dynamic code in the service?