By default, .NET Core now builds framework-dependent executables. This behavior is new for applications that use a globally installed version of .NET Core.
dotnet publish, an executable also known as the
appHostis created that matches the environment and platform of the SDK you are using.
You can expect the same things with these executables as you would other native executables, such as:
myapp.exeon Windows, and
./myappon Linux and macOS.
Executables are not cross-platform and are specific to an operating system and CPU architecture. When publishing your app and creating an executable, you can publish the app as self-contained or framework-dependent.
The following commands produce an executable:
|framework-dependent executable for the current platform.||dotnet publish|
|framework-dependent executable for a specific platform.||dotnet publish -r
|self-contained executable.||dotnet publish -r
Cross-platform binaries are created when you publish your app as framework-dependent, in the form of a
dll file. The
dll file is named after your project. For example, if you have an app named
word_reader, a file named
word_reader.dll is created.
dotnet <filename.dll>command and can be run on any platform.
The following command produces a cross-platform binary:
|framework-dependent cross-platform binary.||dotnet publish|