7

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?


See also https://github.com/dotnet/core/blob/58b0c128d2672bada008d6e2b9e5b29ae70c2c4c/release-notes/3.0/api-diff/Asp.Net/3.0.0_Microsoft.Extensions.Hosting.Systemd.md

and https://levelup.gitconnected.com/net-core-worker-service-as-windows-service-or-linux-daemons-a9579a540b77

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
Mafii
  • 7,227
  • 1
  • 35
  • 55
  • Doesn't seem that way. Wonder how hard it would be to implement _some_ of the stuff in https://github.com/dotnet/runtime/tree/main/src/libraries/Microsoft.Extensions.Hosting.Abstractions – Sören Kuklau May 14 '21 at 09:05

0 Answers0