One of my msbuild targets works as following:
- get configuration files
- start window service with those configuration files
- exec service specific task
- stop window service
- repeat
The issue is that sometimes service stop executable task (Exec Command="sc stop myservice") takes longer time and when "sc start myservice" is called it says that service is already running. So my question is: how can I wait for "exec" command ot finish? I tried to put each executable in target and call with "CallTarget" and putting appropriate "DependsOnTargets" or "AfterTargets" and it didn't work. Can you help me? Thanks in advance.
Execdoes wait until the command is finished - stijnsc? - stijnsc stopreturns before the service is really stopped, hence Exec also returns immediately (because it does wait for full execution, but in this case 'full' isn't emough for you) - stijn