The dll will run on any system via the dotnet utility. But a publish will create a small o/s dependent app to load and run the dll. Just create Linux publish, and there will be Linux app (MacOS and Linux apps do not have a file extension, just the execute bit set in the directory).
A Linux daemon is supposed to fork at startup and respond to signals. Microsoft has a nuget package for creating a daemon hosted by launchd. See this article
And with .net 6 min api
https://stackoverflow.com/questions/71233335/use-systemd-on-asp-net-core-6-0