dotnet / dotnet/dotnet-api-docs

System.ServiceProcess.ServiceBase.Run

Open
#9,349 0 comments 0 reactions 0 assignees View on GitHub
area-System.ServiceProcess doc-enhancement Pri3
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

[System.ServiceProcess.ServiceBase.Run](https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.ServiceProcess/ServiceBase.xml#L1204) states that:

> After you call [Run(ServiceBase)](https://learn.microsoft.com/en-us/dotnet/api/system.serviceprocess.servicebase.run#system-serviceprocess-servicebase-run(system-serviceprocess-servicebase)), the Service Control Manager issues a Start command, which results in a call to the [OnStart](https://learn.microsoft.com/en-us/dotnet/api/system.serviceprocess.servicebase.onstart) method in the service. The service is not started until the Start command is executed.

It would be important to make clear that the SCM will not consider the service started until [OnStart](https://learn.microsoft.com/en-us/dotnet/api/system.serviceprocess.servicebase.onstart) is invoked by the [ServiceBase](https://learn.microsoft.com/en-us/dotnet/api/system.serviceprocess.servicebase) derived class.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.