Microsoft best practices (as documented in SetServiceStatus) states:
Do not register to accept controls while the status is SERVICE_START_PENDING or the service can crash. After initialization is completed, accept the SERVICE_CONTROL_STOP code.
However in ServiceBase.ServiceMainCallback if the service has been configured with CanStop = true it sets the status to accept SERVICE_CONTROL_STOP right away.
Also since CanStop cannot be changed after OnStart is called, there does not appear to be a way to work around this issue.
Microsoft best practices (as documented in SetServiceStatus) states:
However in ServiceBase.ServiceMainCallback if the service has been configured with CanStop = true it sets the status to accept SERVICE_CONTROL_STOP right away.
Also since CanStop cannot be changed after OnStart is called, there does not appear to be a way to work around this issue.