简体   繁体   中英

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). The problem is that publishing the file into a local folder does not do that, there are DLL files, but no EXE.

I know how to do it when creating a .NET Core Console application by command line . 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. How can I do that?

Command Line

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.
  • 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM