Writing worker service on Windows and deploying on Linux

Frank Martin 456 Reputation points

Is it possible to write worker service using .net core on Windows and then generate executable file that can be deployed on Linux? So basically that worker service will run under systemd on Linux. What I am mainly confused about is the .exe part which is generated on Windows so how will we able to deploy in on Linux?

Microsoft Technologies based on the .NET software framework.
3,643 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,141 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 61,491 Reputation points

    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


    0 comments No comments

0 additional answers

Sort by: Most helpful