简体   繁体   English

在VS2017中的.NET核心项目中发布时创建一个exe

[英]Create an exe on publish in a .NET core project in VS2017

I created a console application in .NET Core 2 and wanted to make it an executable file (so I don't have to launch it via Visual Studio 2017). 我在.NET Core 2中创建了一个控制台应用程序,并希望使其成为可执行文件(因此我不必通过Visual Studio 2017启动它)。 The problem is that publishing the file into a local folder does not do that, there are DLL files, but no EXE. 问题在于,将文件发布到本地文件夹不会这样做,因为有DLL文件,但没有EXE。

I know how to do it when creating a .NET Core Console application by command line . 通过命令行创建.NET Core控制台应用程序时,我知道该怎么做 I created a separate simple project and used 我创建了一个单独的简单项目,并使用了

dotnet build -r win10-x64

My problem is that I want to publish my application from Visual Studio 2017. I'm trying to achieve that but with no results. 我的问题是我想从Visual Studio 2017发布我的应用程序。我正在尝试实现这一目标,但没有结果。 How can I do that? 我怎样才能做到这一点?

Command Line 命令行

VS2017 VS2017

  • On the specific publish profile, click configure (next to target location). 在特定的发布配置文件上,单击“配置”(在目标位置旁边)。 You must create the profile first - the UI is not intuitive on this. 您必须先创建配置文件-UI对此不直观。
  • Select a Target Runtime from the list. 从列表中选择目标运行时
  • To add more options to the list, add <RuntimeIdentifiers>linux-x64;win7-x64</RuntimeIdentifiers> to some <PropertyGroup /> in the .csproj file with a list of extra identifiers. 要将更多选项添加到列表中,请将<RuntimeIdentifiers>linux-x64;win7-x64</RuntimeIdentifiers>到具有附加标识符列表的.csproj文件中的某些<PropertyGroup />中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从用于 linux-arm 的 windows VS2017 .NET Core 应用程序发布? - How to publish from windows VS2017 .NET Core application for linux-arm? 无法在VS2017中观察.Net Core应用程序的“发布”菜单项 - Unable to observe “Publish” menu item in VS2017 for .Net Core app 从VS 2017 .NET核心项目中的发布目录中排除文件 - Excluding File From Publish Directory in VS 2017 .NET Core Project VS2017项目菜单中的“发布”命令在哪里? - Where is Publish command in VS2017 project menu? 列出VS2017中给定项目/.NET Core项目的解决方案的所有具有“递归依赖性”的nuget程序包 - List all the nuget packages with “dependencies recursively” for a given project/Solution for .NET Core project in VS2017 无法向 .NET Core 单元测试项目 VS2017 添加单元测试 - Cannot add a unit test to a .NET Core Unit Test Project VS2017 VS2017 .Net Core(完整框架)项目的后构建事件获取$(ConfigurationName)的空字符串 - VS2017 .Net Core (Full Framework) Project's Post Build Event gets empty string for $(ConfigurationName) VS2017中dotnet核心项目的代码分析 - Code analysis for dotnet core project in VS2017 在.NET Core项目的VS2017中禁用调试/启动 - Debug/Start disabled in VS2017 on .NET Core projects VS2017 - 缺少 .net core &gt; 2.1 作为目标框架 - VS2017 - Missing .net core > 2.1 as target framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM