Start windows service yaml task not working

  Kiến thức lập trình

I have a set of yaml tasks where the windows service is getting deployed.

- task: jabbera.windows-service-release-tasks.stop-windows-service-task.StopWindowsService@8
            displayName: 'Stop Windows Service: $(ServiceName)'
            inputs:
              ServiceNames: '$(ServiceName)'
              StartupType: Automatic
              deploymentGroup: true

- task: jabbera.windows-service-release-tasks.install-topshelf-service-task.InstallTopshelfService@8  


- task: jabbera.windows-service-release-tasks.start-windows-service-task.StartWindowsService@8
  condition: ${{ parameters.startService }}
  displayName: 'Start Windows Service: ${{ parameters.serviceName }}'
  inputs:
      ServiceNames: '${{ parameters.serviceName }}'
      deploymentGroup: true

I have not shared all the tasks but they are working fine. The service is getting installed successfully and then on the last task to start it is when it fails with the following error message:

##[error]Exception calling “Start” with “0” argument(s): “Cannot start service myservice on computer ‘.’.”

LEAVE A COMMENT