I followed documentations and articles about Worker Service projects, and created a service that i want to host for Windows as a Windows service and for Linux as a daemon.
For hosting as a Windows Service, i need to add .UseWindowsService() (Microsoft.Extensions.Hosting.WindowsService). For hosting as a daemon, i need to add .UseSystemd() (Microsoft.Extensions.Hosting.Systemd).
What i wonder, can i use something like #if directive, and publish for windows and linux without modifiying the Program.cs ?