c# - 创建asp.net web api core 2.0项目的msi

标签 c# asp.net-core wix windows-services windows-installer

我正在创建一个 ASP.net core 2.0 WEB API 项目,需要将其部署为使用 MSI 设置的系统上的 Windows 服务。有什么办法可以做到吗?

我已经尝试过的事情:

  1. 我使用安装项目创建了一个 MSI,但它没有加载任何依赖项。

  2. 我尝试使用 WIX 创建一个 msi但它显示错误 The WiX Toolset v3.11 (or newer) build tools must be installed to build this project 我已经尝试了已经在 this 上回答的解决方案和 this .

最佳答案

时间紧迫,只是一些链接,看看它是否让你继续:

本质上:

  1. 您需要下载并安装WiX 工具包才能运行 WiX。
  2. 如果您想在 Visual Studio 中使用 WiX 源文件,您还应该获得 Visual Studio Extension(除了主 WiX 下载之外)。
  3. 从这里下载:http://wixtoolset.org/releases/

我喜欢将WiX安装主目录下的bin文件夹添加到Path环境变量中,以便能够调用WiX构建工具-candle.exelight.exe, etc... - 来自任何地方。

您也可以在 Visual Studio 之外编译 WiX 源文件。最简单的形式:

set SetupName=MySetup

candle.exe %SetupName%.wxs >> %SetupName%.log
light.exe -out %SetupName%.msi %SetupName%.wixobj >> %SetupName%.log

或者,没有线路噪声:

candle.exe Setup.wxs
light.exe -out Setup.msi Setup.wixobj

类似问题:

关于c# - 创建asp.net web api core 2.0项目的msi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50635785/

相关文章:

c# - 等同于 asp.net-core 中的 AntiForgery.Validate() 的命令

dialog - 如何在 WiX 安装程序的自定义对话框上启用关闭按钮

visual-studio-2008 - Wix 不会删除 VS 2008 中卸载时的快捷方式

c# - 首先修改由 EF5 代码创建的多对多表

c# - 使用 HttpClient 通过 AttributeRouting 在 URL 中发送日期

asp.net-core - Kubernetes:将入口内部 ip 添加到环境

.net - 我对 .NET Core 中的 web.config 感到困惑

Wix 和 MSMQ : MSMQ Detection

c# - 如何使用自定义对象列表序列化一个类?

c# - 如何将 await/async 与同步代码一起使用?