Easily Install .NET Application on Linux ARM/x64

See also: Install ASP.NET Core on Ubuntu Linux and Configure it to Serve a Web Application

Using Visual Studio

If using Visual Studio, the simpliest way to install a .NET app on Linux is to publish it into a folder and then as a "Self-contained" deployment mode.

Choose to target a folder.

Choose to target a folder again.

Enter the folder.

Then edit the publish settings and choose a deployment mode of Self-contained.

Under File publish options is a choice to Produce single file if wanting to have a single file, and not several assemblies, to copy between computers or otherwise distribute. It's also possible to Trim unused assemblies from here to make the executable smaller.

Using the .NET CLI (dotnet)

If developing on Linux or just prefer using the .NET Command Line Interface (CLI) then publish with this command:

dotnet publish -r linux-arm -o <OUTPUT_DIRECTORY>

or:

dotnet publish -r linux-x64 -o <OUTPUT_DIRECTORY>

These commands will produce a self-contained distribution for Linux ARM and Linux x64, respectively.

Copy Files to the Linux Host

Use Secure CoPy (SCP) to copy published files from a Windows 10 (or later) machine or a Linux machine to the Linux host.

scp C:\Users\User\Desktop\published-directory user@hostname-or-ip:/path/to/destination

Make sure the destination folder on the Linux host has write permissions and then make sure the executable uploaded to the Linux host has execute permissions. The easiest way to do this is with "chmod 0777":

sudo chmod 0777 /path/to/destination

and:

sudo chmod 0777 executable-file-path

Cookies are simple text files stored on the user's computer. They are used for adding features and security to this site.
OK