I want to create a self-contained executable for my .NET Core Console application that can be run on the command line without the dotnet command. When I try to create a self contained executable using dotnet publish -r osx-x64, a .dll with the project name is created in the output folder, e.g. myproject.dll, instead of an EXE file (I'm assuming on MacOS self contained applications are EXE files just like on Windows). I cannot run myproject.dll directly without using the dotnet command, I have to run dotnet myproject.dll arg1 in order for the program to execute.
Adding on to @MyWrathAcademia's answer...
A self contained application does not require the .NET Runtime on the target system, and bundles it's own .NET Runtime. A runtime dependent application depends on the .NET Runtime on the target system, so it has to be executed using "dotnet run".
See here for more information.
The executable file is in the publish folder. In Windows executables have a .exe file extension where as on Linux and OSX (i.e. MacOS) executables do not have file extensions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With