Build .exe with .net core

Answered

Hello, I have just learned C# with rider. When i found in the folder bin\Debug\netcoreapp2.0, I don't see the file .exe. How to build the programe to .exe?

1 comment
Comment actions Permalink

Hello!

Thank you for contacting us. 

In .NET Core, if you'd like to generate an .exe file produced during dotnet build, you need to specify a target platform in MSBuild property RuntimeIdentifier in .csproj file.

<RuntimeIdentifier>win10-x64</RuntimeIdentifier>

But note that by default dotnet core generates .dll file instead of .exe. And you can run it with command bellow on any OS

dotnet filename.dll
1

Please sign in to leave a comment.