[英]Generating .NET Core Console App .exe in Visual Studio 2017
(I am using Visual Studio 2017) (我正在使用Visual Studio 2017)
I started a small console application (I created a .NET Core application), then I wanted to build the .exe file. 我启动了一个小型控制台应用程序(创建了.NET Core应用程序),然后想要构建.exe文件。 But all I get is .dll files and there isn't any .exe file.
但我得到的只是.dll文件,没有任何.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?
我如何在Visual Studios设置中进行更改,以在控制台应用程序的正确目录中包含一个.exe文件?
In fact .NET Core by default generates only dll
files that can be run with dotnet
: 实际上,.NET Core默认情况下仅生成可以通过
dotnet
运行的dll
文件:
dotnet myapp.dll
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 . 如果要将应用程序发布为自包含
exe
,则必须在解决方案资源管理器中右键单击该项目,选择“ 发布” ,然后选择自包含选项,并选择win-x86或win-x64 。 This will generate a platform specific, architecture specific exe
. 这将生成特定于平台,特定于体系结构的
exe
。
Check out this blogpost that goes into more detail about this process. 请查看此博客文章 ,其中将详细介绍此过程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.