【问题标题】:Create an exe on publish in a .NET core project in VS2017在 VS2017 的 .NET 核心项目中发布时创建 exe
【发布时间】:2019-03-22 22:30:27
【问题描述】:

我在 .NET Core 2 中创建了一个控制台应用程序,并希望将其设为可执行文件(因此我不必通过 Visual Studio 2017 启动它)。问题是,将文件发布到本地文件夹不会这样做,有 DLL 文件,但没有 EXE。

I know how to do it when creating a .NET Core Console application by command line。我创建了一个单独的简单项目并使用了

dotnet build -r win10-x64

我的问题是我想从 Visual Studio 2017 发布我的应用程序。我正在努力实现这一目标,但没有任何结果。我该怎么做?

【问题讨论】:

    标签: .net-core visual-studio-2017 publish


    【解决方案1】:

    命令行

    VS2017

    • 在特定的发布配置文件上,单击配置(目标位置旁边)。您必须先创建配置文件 - 用户界面对此并不直观。
    • 从列表中选择一个目标运行时
    • 要向列表中添加更多选项,请将<RuntimeIdentifiers>linux-x64;win7-x64</RuntimeIdentifiers> 添加到带有额外标识符列表的.csproj 文件中的某些<PropertyGroup />

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-19
      • 1970-01-01
      相关资源
      最近更新 更多