ServiceBase.Run Method (ServiceBase)
Registers the executable for a service with the Service Control Manager (SCM).
Assembly: System.ServiceProcess (in System.ServiceProcess.dll)
Call this overload in the main() function of the service executable to register the service with the Service Control Manager. After you call , the Service Control Manager issues a Start command, which results in a call to the OnStart method in the service. The service is not started until the Start command is executed.
If AutoLog is true, an entry is written to the event log if the service specified by the service parameter fails to start.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.