UtilServicingSetStatus(String, 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(
	string svcName,
	ServiceStatus status,
	bool wait = false,
	bool throwOnStatusMissmatch = false
)

Parameters

svcName  String
The service name.
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.

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

Exceptions

ArgumentException Any service found with the specified name.;svcName
ServiceDependancyDisabledException Cannot start service because a dependant service is disabled.
Exception Cannot start or stop service because it is disabled. or The service is already running or pendng to run it. or The service is already stopped or pendng to stop it.
InvalidEnumArgumentException status

See Also