在Visual Studio 2017中生成.NET Core控制台应用程序.exe

编程入门 行业动态 更新时间:2024-10-18 03:31:45
本文介绍了在Visual Studio 2017中生成.NET Core控制台应用程序.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

(我正在使用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

本文发布于:2023-11-13 15:07:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584662.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   应用程序   Studio   Visual   exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!