ServiceInstaller.StartType Property

Definition

Indicates how and when this service is started.

C#
public System.ServiceProcess.ServiceStartMode StartType { get; set; }
C#
[System.ServiceProcess.ServiceProcessDescription("ServiceInstallerStartType")]
public System.ServiceProcess.ServiceStartMode StartType { get; set; }

Property Value

A ServiceStartMode that represents the way the service is started. The default is Manual, which specifies that the service will not automatically start after reboot.

Attributes

Exceptions

The start mode is not a value of the ServiceStartMode enumeration.

Remarks

Set the StartType to specify either that the service be started automatically after reboot or that a user must manually start the service. A service can also be disabled, specifying that it cannot be started, either manually or programmatically, until it is enabled.

You cannot change ServiceInstaller property values after installation. To change the StartType, you either have to uninstall and reinstall your service, or manually change the setting using the Service Control Manager.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also