.Net 5 后台服务的 MSI 安装程序

MSI installer for .Net 5 background service

我有一个 .Net 5 控制台应用程序,我正在尝试 运行 作为 Windows 服务。我已经阅读了所有关于如何执行此操作并成功完成的在线文章(即:使用 BackgroundService)。问题是,我想要一个 MSI 安装程序来部署它,我读过的所有关于在 .Net 5 中创建服务的文章都指导我使用命令提示符或 power shell 手动安装服务并发出“sc”命令。

回到 .Net 5 之前,我可以使用内置的 Visual Studio 安装程序扩展并简单地创建一个 MSI 来部署和安装我的服务。我似乎无法为 .Net 5 工作。

是否仍然可以使用内置的安装程序扩展来部署和安装我的 .Net 5 BackgroundService?

谢谢!

Installing Services: 安装服务有很多种方法,你应该使用 MSI 包和内置机制来安装和启动该服务并在升级期间停止和更新它。

Various ways to install services(包含有关如何使用 MSI 安装服务的示例链接)。

学习 WiX:请参阅 WiX section here - the links should get you started. Direct link to the main WiX link list.


链接: