Microsoft has defined the IHostLifetime
interface for WorkerServices to run as services on different platforms. (You can create a Worker Service project with dotnet new worker
in the console).
If you want to run them as system services, you can use the extensions from Microsoft for systemd and Windows Services (See Nuget Windows Service and Systemd).
Is there already an implementation for MacOS (e.g. launchd) or would I need to do that one for myself if I want to support MacOS with my service, too?