Search code examples
topshelf

Does a class implementing service operations need to be wired up for every action?


If a class implements ServiceControl, ServiceSuspend, ServiceShutdown, ServiceCustomCommand, ServicePowerEvent and/or ServiceSessionChange, do those actions still have to be wired up through HostConfigurators WhenXXX methods?


Solution

  • If the service class implements the interfaces, such as ServiceControl, then there is no need to configure the WhenStarted and other methods since Topshelf will use the interface methods.

    From the docs: http://topshelf.readthedocs.io/en/latest/configuration/config_api.html#simple-service