VSTS 在线建筑安装项目?

VSTS Online Building Setup Projects?

我有一个带有安装项目的 .NET 控制台应用程序,我正在尝试移植到 VSTS Online (visualstudio.com) 以利用源代码管理并添加自动化 build/deploy。

我已将代码上传得很好并且构建得很好,但我正在努力让它生成 MSI。我已经尝试在解决方案构建到 运行 devenv.com 之后引入命令行任务,但我无法让它正常工作。关于获取安装项目以构建其 MSI 的任何想法?

谢谢!

编辑:

这是我试过的命令行任务:

Tool: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv
Arguments: SolutionName.sln /Build $(BuildConfiguration) /Project Setup\Setup.vdproj

编辑 2:

新命令行:

Tool: C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE\devenv.com
Arguments: MySolution.sln /Build $(BuildConfiguration) /Project Setup\Setup.vdproj

日志:

2017-10-04T17:58:48.7033117Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE\devenv.com" MySolution.sln /Build release /Project Setup\Setup.vdproj
2017-10-04T17:59:12.1156461Z microsoft.visualstudio.telemetry.dll
2017-10-04T17:59:12.1196471Z microsoft.visualstudio.telemetry.dll
2017-10-04T17:59:12.1196471Z microsoft.visualstudio.telemetry.dll
2017-10-04T17:59:12.1196471Z microsoft.visualstudio.telemetry.dll
2017-10-04T17:59:12.1206475Z microsoft.visualstudio.telemetry.dll
2017-10-04T17:59:12.1206475Z microsoft.visualstudio.telemetry.dll
2017-10-04T17:59:12.1206475Z microsoft.visualstudio.extensionmanager.implementation.dll
2017-10-04T17:59:46.2231714Z 
2017-10-04T17:59:46.2231714Z Microsoft Visual Studio 2017 Version 15.0.26730.3.
2017-10-04T17:59:46.2231714Z Copyright (C) Microsoft Corp. All rights reserved.
2017-10-04T17:59:46.2231714Z 
2017-10-04T17:59:46.2231714Z Some errors occurred during migration. For more information, see the migration report:
2017-10-04T17:59:46.2231714Z d:\a\s\UpgradeLog.htm
2017-10-04T17:59:46.4634939Z ========== Build: 0 succeeded or up-to-date, 0 failed, 0 skipped ==========
2017-10-04T17:59:48.5239469Z ##[section]Finishing: Run C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE\devenv.com

编辑 3:

根据@Marina - MSFT,我已经尝试了 Build VS Installer,但它对我来说不太管用。任务成功完成,但似乎 MSI 从未实际生成,因为工件掉落中没有任何内容。以下是任务的日志:

2017-10-04T20:38:12.1314337Z ##[section]Starting: Create .msi file(s) from VS Installer project(s).
2017-10-04T20:38:12.1314337Z ==============================================================================
2017-10-04T20:38:12.1314337Z Task : DutchWorkz - Build VS Installer(s)
2017-10-04T20:38:12.1314337Z Description : Build .msi file(s) from VS Installer project(s).
2017-10-04T20:38:12.1314337Z Version : 1.2.4
2017-10-04T20:38:12.1314337Z Author : DutchWorkz B.V.
2017-10-04T20:38:12.1324342Z Help : <b>BuildVsInstaller v1.2.4</b>, DutchWorkz B.V. (Robin Paardekam)<br/><br/>Visual Studio Installer projects are not supported by MSBUILD, so a regular build will not generate your installer files (.msi). Use this build-task to build the .msi file(s) for your project by running devenv on the buildagent directly. <br/><br/><b>Dependencies:</b><br/>Dep1: when using VisualStudio 2017, this task will only function properly if you installed it in the default C:\Program Files (x86)\ location.
2017-10-04T20:38:12.1324342Z ==============================================================================
2017-10-04T20:38:15.3883721Z DEBUG: Aggregated: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\IDE\devenv.com
2017-10-04T20:38:15.4043950Z Now running (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\IDE\devenv.com) with Arguments ("d:\a\s\MySolution.sln" /Build "release|any cpu" /Project "d:\a\s\Setup\Setup.vdproj" /Out "d:\a\b\BuildInstaller_Log_20171004203815.txt")
2017-10-04T20:39:39.8930682Z Done running DevEnv process. Success = True.
2017-10-04T20:39:39.8950669Z The single MSI should be located here: d:\a\s\Setup\release\
2017-10-04T20:39:40.0450669Z ##[warning]No .MSI files were found, please check your build-configuration. If this is expected, you might consider to use the default Visual Studio Build task instead of this custom Installer task.
2017-10-04T20:39:40.0560673Z ##[section]Finishing: Create .msi file(s) from VS Installer project(s).

任务配置

要通过 VS 安装程序项目构建 .msi 文件,您可以在市场中使用 Build VS Installer 任务

您可以在 Task-mode 选项中指定构建 .sln.vdproj 以生成 .msi 文件。

您必须 configure your own build agent 到 运行 构建,因为 Visual Studio 安装程序项目扩展未安装在 Hosted 和 Hosted 2017 Agent 上。

确保 VS 安装程序项目扩展安装在您自己的构建代理上,然后您可以使用带 "devenv" 的命令行任务或使用 "Build VS Installer" 任务来构建安装项目。

如果您收到如下所示的“8000000A”错误: 请按照此处的说明配置您的构建代理:Solution: An error occurred while validating. HRESULT = '8000000A'.

那么你应该可以成功构建安装项目: