On Windows there are windows services, on Linux there are daemons.
Is it possible write one code using .net core which works on Windows like a service and on Linux like a daemon? Or I must write different system dependent start code?
On Windows there are windows services, on Linux there are daemons.
Is it possible write one code using .net core which works on Windows like a service and on Linux like a daemon? Or I must write different system dependent start code?
Services and *daemons (not demons) are simply ways for the OS to manage executables/scripts, so as long as the code is OS independent (like .NET core) you should be able to use the same code base.
Running an executable as a daemon/service will vary based on the operating system. As such, I've linked to some existing stack overflow questions that should help a little.
How do you create a Linux daemon from a .NET Core console application?
See Worker Services (if you can now use .NET Core 3.x):
You can create one from the new Visual Studio 2019 Worker Service project template, or by using the .NET CLI:
dotnet new worker