(我正在使用Visual Studio 2017)
(I am using Visual Studio 2017)
我启动了一个小型控制台应用程序(创建了.NET Core应用程序),然后我想构建.exe文件. 但是我得到的只是.dll文件,没有任何.exe文件.
I started a small console application (I created a .NET Core application), then I wanted to build the .exe file. But all I get is .dll files and there isn't any .exe file.
你能帮我吗?我要在Visual Studios设置中进行哪些更改,以便在我的控制台应用程序的正确目录中包含一个.exe文件?
Can you help me please ? what do I change in Visual Studios settings, to have an .exe file in my correct directory for my console application?
推荐答案事实上,.NET Core默认情况下仅生成可以使用dotnet运行的dll文件:
In fact .NET Core by default generates only dll files that can be run with dotnet:
dotnet myapp.dll如果要将应用程序发布为独立的exe,则必须在 Solution Explorer 中右键单击该项目,选择 Publish ,然后选择自包含选项,以及 win-x86 或 win-x64 .这将生成特定于平台,特定于体系结构的exe.
If you want to publish the app as a self-contained exe, you have to right-click the project in Solution Explorer, select Publish and then choose the self-contained option and either win-x86 or win-x64. This will generate a platform specific, architecture specific exe.
签出此博文,其中会详细介绍此过程.
Check out this blogpost that goes into more detail about this process.
更多推荐
在Visual Studio 2017中生成.NET Core控制台应用程序.exe
发布评论