Compile a .NET Core application as an EXE file using Visual Studio 2017

前端 未结 5 1526
不思量自难忘°
不思量自难忘° 2020-11-28 09:10

I created a .NET Core application (v1.1) in Visual Studio 2017. When I compile it, I get a DLL file produced instead of the expected EXE file for the built project. I did ch

5条回答
  •  不知归路
    2020-11-28 09:30

    That's how you do a self-contained publish with command-line in any OS:

    dotnet publish C:\src\App\App.csproj -c release -r win-x64 -o output-win-x64
    

    Besides, you might want to get the output decreased from typical ~60 MB for a simple Hello World app to ~30 MB by using ILLink.

    Also, you might want to go further and get a single .exe file of a size at around 5 MB and use ILCompiler. See this reply.

提交回复
热议问题