【问题标题】:How to create an exe for .NetCore service如何为 .NetCore 服务创建 exe
【发布时间】:2019-08-12 08:03:13
【问题描述】:

我使用 Topshelf 在 C# 中创建了一个服务应用程序。然而,我为 .NetCore 平台而不是 .Net 框架创建了它。现在我想在另一台机器上部署服务应用程序以在开发区域之外对其进行测试。似乎在 Visual Studio 中构建后,我只找到一个 DLL 和一个 .exe。我需要做些什么来获取 exe,还是因为 .NetCore 平台我只有一个 dll,我该如何部署服务?我这里要补充的是,当我在 Visual Studio 中创建项目时,我创建了一个 Consol App (.NET Core),并使用了 TopShelf 框架。

【问题讨论】:

    标签: visual-studio .net-core topshelf


    【解决方案1】:

    您可以使用 dll 来运行 .net core。要运行 .NET Core,您只需要安装 .NET Core Runtime,它可以在 here 找到。然后在这台机器上,您只需在 cmd / powershell 中使用 dotnet ApplicationName.dll。 如果要创建 exe 文件而不是 dll,则应使用命令:dotnet publish -r win10-x64

    您可以在documentation找到更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-06-09
      • 1970-01-01
      • 2014-08-26
      • 2022-08-20
      • 2019-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多