For debugging purposes, you can use the dllDLL file. You can run it using dotnet ConsoleApp2.dll. If you want to generate an exeEXE file, you have to generate a self-contained application.
To generate a self-contained application (exeEXE in windowsWindows), you must specify the target runtime (which is specific to the OSoperating system you target).
Pre-.NET Core 2.0 only: First, add the runtime identifier of the target runtimes in the csproj .csproj file (list of supported ridRIDs):
<PropertyGroup> <RuntimeIdentifiers>win10-x64;ubuntu.16.10-x64</RuntimeIdentifiers> </PropertyGroup> The above step is no longer required starting with .NET Core 2.0.
Then, set the desired runtime when you publish your application:
dotnet publish -c Release -r win10-x64 dotnet publish -c Release -r ubuntu.16.10-x64