UtilServicingSetStatus(ServiceController, ServiceStatus, Boolean, Boolean) Method

Sets the status of a service.

Definition

Namespace: DevCase.Core.Windows.Servicing
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static void SetStatus(
	ServiceController svc,
	ServiceStatus status,
	bool wait = false,
	bool throwOnStatusMissmatch = false
)

Parameters

svc  ServiceController
The service.
status  ServiceStatus
The target service status.
wait  Boolean  (Optional)
if set to waits for the status change completition.
throwOnStatusMissmatch  Boolean  (Optional)
If set to , throws an error when attempting to start a service that is started, or attempting to stop a service that is stopped.

See Also