2017-10-04 92 views
0

我有一个安装项目的.NET控制台应用程序,我尝试移植到VSTS Online(visualstudio.com)以使用源代码管理以及添加自动构建/部署。VSTS在线建筑安装项目?

我已经把代码上传得很好,它建立很好,但我正在努力让它产生一个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 Studio\2017\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 Studio\2017\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\1\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 Studio\2017\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\1\s\MySolution.sln" /Build "release|any cpu" /Project "d:\a\1\s\Setup\Setup.vdproj" /Out "d:\a\1\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\1\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). 

任务配置

Task Config

+0

如果您在自己的机器上运行这些相同的命令行参数,你最终得到的MSI? – mason

+0

是的,我已经运行了C:Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ devenv.com“SolutionName.sln/Build”release | any cpu“/ Project Setup \ Setup.vdproj'在本地机器上取得成功。 – Hershizer33

+0

当您将它作为VSTS发行版定义的一部分时,会发生什么?你会得到什么错误? “无法完成这项工作”不是一个体面的错误描述。 – mason

回答

1

你必须configure your own build agent,因为Visual Studio安装项目扩展未在托管& 2017年托管代理安装到运行构建。

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

,如果你得到了“8000000A”错误,如下列: enter image description here 请按照指示在这里配置构建代理:Solution: An error occurred while validating. HRESULT = '8000000A'

那么你应该能够建立成功安装项目: enter image description here

2

打造由VS安装项目.msi文件,你可以使用Build VS Installer任务的市场。

您可以指定生成.sln.vdproj以在任务模式选项中生成.msi文件。

enter image description here

+0

谢谢!我只是尝试过,并不能完全实现。该任务成功完成,但似乎MSI从未实际生成,并且不出现在工件下拉菜单中。这是我的任务日志:'完成运行DevEnv进程。成功=真。单个MSI应位于此处:d:\ a \ 1 \ s \ Setup \ release \。 ## [警告]找不到.MSI文件,请检查您的构建配置。如果这是预期的,则可以考虑使用默认的Visual Studio Build任务而不是此定制安装程序任务。' – Hershizer33

+0

您可以在此处添加带有任务配置的屏幕快照吗? –

+0

将其添加到问题 – Hershizer33