I have a .NET Core console app and have run dotnet publish. However, I can\'t figure out how to run the application from the command line. Any hints?
With dotnetcore3.0 you can package entire solution into a single-file executable using PublishSingleFile property
-p:PublishSingleFile=True
Source Single-file executables
An example of Self Contained, Release OSX executable:
dotnet publish -c Release -r osx-x64 -p:PublishSingleFile=True --self-contained True
An example of Self Contained, Debug Linux 64bit executable:
dotnet publish -c Debug -r linux-x64 -p:PublishSingleFile=True --self-contained True
Linux build is independed of distribution and I have found them working on Ubuntu 18.10, CentOS 7.7, and Amazon Linux 2.
A Self Contained executable includes Dotnet Runtime and Runtime does not require to be installed on a target machine. The published executables are saved under:
on Linux, OSX and
on Windows.