加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – VSTS在线建筑设置项目?

发布时间:2020-12-15 23:40:56 所属栏目:百科 来源:网络整理
导读:我有一个带有安装项目的.NET控制台应用程序我试图移植到VSTS Online(visualstudio.com)以利用源代码控制以及添加自动构建/部署. 我已经将代码上传得很好并且它构建得很好,但我正在努力让它产生一个MSI.我已经尝试在解决方案构建之后引入一个命令行任务来运行
我有一个带有安装项目的.NET控制台应用程序我试图移植到VSTS Online(visualstudio.com)以利用源代码控制以及添加自动构建/部署.

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

谢谢!

编辑:

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

Tool: C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEdevenv
Arguments: SolutionName.sln /Build $(BuildConfiguration) /Project SetupSetup.vdproj

编辑2:

新命令行:

Tool: C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDEdevenv.com
Arguments: MySolution.sln /Build $(BuildConfiguration) /Project SetupSetup.vdproj

日志:

2017-10-04T17:58:48.7033117Z ##[command]"C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDEdevenv.com" MySolution.sln /Build release /Project SetupSetup.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:a1sUpgradeLog.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 Studio2017EnterpriseCommon7IDEdevenv.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.0Common7Tools..IDEdevenv.com
2017-10-04T20:38:15.4043950Z Now running (C:Program Files (x86)Microsoft Visual Studio 14.0Common7Tools..IDEdevenv.com) with Arguments ("d:a1sMySolution.sln" /Build "release|any cpu" /Project "d:a1sSetupSetup.vdproj" /Out "d:a1bBuildInstaller_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:a1sSetuprelease
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

解决方法

您必须 configure your own build agent才能运行构建,因为Hosted& amp;上没有安装Visual Studio Installer Projects扩展.主持2017年代理.

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

如果您收到“8000000A”错误,如下所示:

enter image description here


请按照此处的说明配置构建代理:Solution: An error occurred while validating. HRESULT = ‘8000000A’.

然后,您应该能够成功构建安装项目:

enter image description here

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读