I\'m using Visual Studio 2019 to publish a self contained .net core 2.1 app. Many files are emitted during the publishing (application files as well as core libraries).
A self-contained app will contain everything needed to run the app.
To run the app, there is no dotnet.exe
but an executable named as your app. So
dotnet publish myapp.csproj -r win-x64
will create a myapp.exe
by default.
For linux runtimes (e.g. -r linux-x64
) the executable will be extension less and is supposed to be run as ./myapp
.
You only need to install .NET Core components if you want to host a self-contained ASP.NET Core application from IIS, since you will need an IIS module to bootstrap the application. You can use this approach though to run newer or preview versions of the .NET Core runtime that you don't want to install globally.
Figured this out by using "file" to look at files. Turns out that when you publish app "Foo" for linux, you end up with a file named Foo which is actually an executable the launches your whole app (ie and any libraries it needs, etc).
In other words, there is no "dotnet" command included or needed. Effectively, Foo takes the place of dotnet executable.