tags:

views:

316

answers:

1

I'm trying to check if a service exists on a remote machine using the Microsoft.Sdc.Tasks.ServiceProcess.ControlService task.

<ControlService  MachineName="$(TargetMachineName)" Action="Exists" ServiceName="w3svc">
    <Output PropertyName="W3ServiceExists" TaskParameter="ServiceExists" />
</ControlService>

When I use the above task declaration I get this output from MSBUILD.

(42,54): error MSB4065: The "ServiceExists" parameter is not marked for output by the "ControlService" task.

Is there a way to use the ControlService class to get whether or not a service exists on a remote machine?

+1  A: 

The answer was to pull the code and recompile with the ServiceExists property properly marked with the [Output] attribute.

Would recommend anyone that finds this answer look at the MS Build Extension Pack instead as this problem doesn't exist in that set of MS Build tasks and it is more actively developed.

spoon16