微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在Azure DevOps中从.vdproj构建安装项目?

如何解决如何在Azure DevOps中从.vdproj构建安装项目?

我最近将一些Windows应用程序升级到VS2019,并使用VS2019中的VSInstallerProject扩展名创建了安装项目。我注意到的是,运行“发布”管道时未创建安装程序,但是我在这里需要msi(或exe)文件,以便可以在应用程序服务器上安装该文件

我对管道进行了更改,并在发行管道中添加一个任务:'DutchWorkz-Build VS Installer(s)'。 我已在下面的Azure Devops中附上了我在执行此任务时遇到的错误的日志。 在此任务上构建失败。

有人可以指导我解决这里的问题以及如何解决吗? 另外,我想在VS2019中创建安装项目/ msi,但在此任务中看不到Vs2019选项, 如何在VS2019版本中使用此任务。我在代理服务器上安装了Vs2019。

agent server

build definition

2020-09-21T20:04:43.3394997Z ##[section]Starting: Create .msi file(s) from VS Installer project(s).
2020-09-21T20:04:43.3539534Z ==============================================================================
2020-09-21T20:04:43.3539958Z Task         : DutchWorkz - Build VS Installer(s)
2020-09-21T20:04:43.3540023Z Description  : Build .msi file(s) from VS Installer project(s).
2020-09-21T20:04:43.3540076Z Version      : 1.2.4
2020-09-21T20:04:43.3540129Z Author       : DutchWorkz B.V.
2020-09-21T20:04:43.3540201Z 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.
2020-09-21T20:04:43.3540311Z ==============================================================================
2020-09-21T20:05:07.5667900Z DEBUG: Aggregated: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com
2020-09-21T20:05:07.5714835Z Now running (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com) with Arguments ("D:\VSTS Agent Folder\SO\6\s\SOApplications.sln" /Build "release|any cpu" /Project "D:\VSTS Agent Folder\SO\6\s\App_Tool_Installer\App_Tool_Installer.vdproj" /Out "D:\VSTS Agent Folder\SO\6\b\BuildInstaller_Log_20200921200507.txt")
2020-09-21T20:05:15.0213322Z Done running DevEnv process. Success = False.
2020-09-21T20:05:15.0238151Z ##[error]Unable to process command '##vso[task.addattachment type=distributedtask.Core.Summary;name=Installer project errors;]D:\VSTS Agent Folder\SO\6\b\BuildInstaller_Log_20200921200507.txt' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
2020-09-21T20:05:15.0239574Z ##[error]Cannot upload task attachment file,attachment file location is not specified or attachment file not exist on disk
2020-09-21T20:05:15.1116369Z Attachment added: Log file for Installer generation.
2020-09-21T20:05:15.1928578Z ##[error]An error occurred while running DevEnv! Please review logfile BuildInstaller_Log_20200921200507.txt
2020-09-21T20:05:15.2720322Z ##[section]Finishing: Create .msi file(s) from VS Installer project(s).

我也尝试使用devenv命令行来构建安装项目。我在vs2017(专业版)和vs 2019(企业版)中都尝试过,但在这两个方面都遇到了问题。虽然2017年的问题是关于许可证,我不知道是什么原因导致了2019年的问题。如果您对可能导致此问题的原因以及如何解决此问题有任何想法,请告诉我。目的是通过azure devops管道构建安装项目,并使用生成的msi文件在应用程序服务器上进行安装是不可行的。 预先感谢。

这是新版本和发行的屏幕截图:

new build def

issue with 2019

issue with 2017

Build Agent服务器已经安装了Vs安装程序,请查看是否可以:

vsinstaller

请从下面的“命令行任务”中检查新日志:

2020-09-26T16:04:39.7854210Z ##[debug]Evaluating condition for step: 'Command Line Script'
2020-09-26T16:04:39.7856182Z ##[debug]Evaluating: succeeded()
2020-09-26T16:04:39.7856654Z ##[debug]Evaluating succeeded:
2020-09-26T16:04:39.7857594Z ##[debug]=> True
2020-09-26T16:04:39.7858101Z ##[debug]Result: True
2020-09-26T16:04:39.7858600Z ##[section]Starting: Command Line Script
2020-09-26T16:04:39.8082090Z ==============================================================================
2020-09-26T16:04:39.8082357Z Task         : Command line
2020-09-26T16:04:39.8082602Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2020-09-26T16:04:39.8082847Z Version      : 2.164.2
2020-09-26T16:04:39.8083025Z Author       : Microsoft Corporation
2020-09-26T16:04:39.8083274Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2020-09-26T16:04:39.8084133Z ==============================================================================
2020-09-26T16:04:39.8097829Z ##[debug]tf vc resolvePath $\CDM\Dev /loginType:OAuth /login:.,*** /noprompt
2020-09-26T16:04:40.1991127Z ##[debug]D:\VSTSAgent\sn\30\s
2020-09-26T16:04:41.0198149Z ##[debug]VstsTaskSdk 0.9.0 commit 6c48b16164b9a1c9548776ad2062dad5cd543352
2020-09-26T16:04:41.1044331Z ##[debug]Entering D:\VSTSAgent\sn\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.164.2\cmdline.ps1.
2020-09-26T16:04:41.1126277Z ##[debug]Loading resource strings from: D:\VSTSAgent\sn\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.164.2\task.json
2020-09-26T16:04:41.1272687Z ##[debug]Loaded 6 strings.
2020-09-26T16:04:41.1306950Z ##[debug]SYstem_CULTURE: 'en-US'
2020-09-26T16:04:41.1325343Z ##[debug]Loading resource strings from: D:\VSTSAgent\sn\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.164.2\Strings\resources.resjson\en-US\resources.resjson
2020-09-26T16:04:41.1467074Z ##[debug]Loaded 6 strings.
2020-09-26T16:04:41.1670941Z ##[debug]INPUT_FAILONSTDERR: 'false'
2020-09-26T16:04:41.1696717Z ##[debug] Converted to bool: False
2020-09-26T16:04:41.1718695Z ##[debug]INPUT_SCRIPT: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv" "D:\VSTSAgent\sn\30\s\st.sn.ComponentManagement.sln" /build release'
2020-09-26T16:04:41.1739155Z ##[debug]INPUT_WORKINGDIRECTORY: 'D:\VSTSAgent\sn\30\s'
2020-09-26T16:04:41.1861366Z ##[debug]Asserting container path exists: 'D:\VSTSAgent\sn\30\s'
2020-09-26T16:04:41.1900763Z Generating script.
2020-09-26T16:04:41.1963727Z Script contents:
2020-09-26T16:04:41.1969048Z "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv" "D:\VSTSAgent\sn\30\s\st.sn.ComponentManagement.sln" /build release
2020-09-26T16:04:41.2078510Z ##[debug]AGENT_VERSION: '2.173.0'
2020-09-26T16:04:41.2148233Z ##[debug]AGENT_TEMPDIRECTORY: 'D:\VSTSAgent\sn\_temp'
2020-09-26T16:04:41.2166134Z ##[debug]Asserting container path exists: 'D:\VSTSAgent\sn\_temp'
2020-09-26T16:04:41.2329780Z ##[debug]Asserting leaf path exists: 'C:\Windows\system32\cmd.exe'
2020-09-26T16:04:41.2337995Z ========================== Starting Command Output ===========================
2020-09-26T16:04:41.2446509Z ##[debug]Entering Invoke-VstsTool.
2020-09-26T16:04:41.2539207Z ##[debug] Arguments: '/D /E:ON /V:OFF /S /C "CALL "D:\VSTSAgent\sn\_temp\442cb1cb-a43b-4d2a-b036-4f16ab588410.cmd""'
2020-09-26T16:04:41.2553937Z ##[debug] FileName: 'C:\Windows\system32\cmd.exe'
2020-09-26T16:04:41.2568488Z ##[debug] WorkingDirectory: 'D:\VSTSAgent\sn\30\s'
2020-09-26T16:04:41.2608339Z ##[command]"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\VSTSAgent\sn\_temp\442cb1cb-a43b-4d2a-b036-4f16ab588410.cmd""
2020-09-26T16:04:47.9474432Z 
2020-09-26T16:04:47.9514773Z Microsoft Visual Studio 2019 Version 16.7.3.
2020-09-26T16:04:47.9656002Z copyright (C) Microsoft Corp. All rights reserved.
2020-09-26T16:04:47.9656269Z 
2020-09-26T16:04:47.9656416Z The license for Visual Studio expires in 19 days.
2020-09-26T16:04:47.9656554Z 
2020-09-26T16:04:47.9657872Z Some errors occurred during migration. For more information,see the migration report:
2020-09-26T16:04:47.9658144Z D:\VSTSAgent\sn\30\s\UpgradeLog2.htm
2020-09-26T16:04:50.0902169Z 1>------ Build started: Project: st.sn.ComponentManagement,Configuration: Release x86 ------
2020-09-26T16:04:52.8763939Z ========== Build: 1 succeeded,0 Failed,6 up-to-date,0 skipped ==========
2020-09-26T16:04:53.4375608Z ##[debug]Exit code: 0
2020-09-26T16:04:53.4417000Z ##[debug]Leaving Invoke-VstsTool.
2020-09-26T16:04:53.4426510Z ##[debug]Leaving D:\VSTSAgent\sn\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.164.2\cmdline.ps1.
2020-09-26T16:04:53.5245394Z ##[section]Finishing: Command Line Script

这是其他错误日志:

additional log

即使通过了命令行任务,.vdproj安装项目也没有得到更新或构建。我可以从时间戳看到,所有其他项目都照常进行更新。

解决方法

我发现了一个类似的ticket,您可以参考它。

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

如果出现类似8000000A的错误,则可以按照此处的说明配置自托管代理:解决方案:An error occurred while validating. HRESULT = '8000000A'。

顺便说一句,由于此扩展是由第三方开发的。您可以连接扩展所有者以获取详细信息

更新1

我们可以安装扩展Build VS Installer并使用任务DutchWorkz - Build VS Installer(s)在Azure Pipelines中构建Visual Studio Installer项目。

enter image description here

,

我在此位置-https://marketplace.visualstudio.com/items?itemName=dutchworkz.BuildInstaller&ssr=false#review-details

看了您提到的包裹

如果您去那里查看其他用户留下的评论,则错误是在构建过程中出现的。原始开发人员尚未修复它。

同时,就像用户提到的那样,您可以看到msi安装程序并使用它。因此,(我假设)您正在获得所需的安装程序。

我最好的建议是,由于您已获得所需的东西,因此请忽略该错误并等待开发人员解决此问题。在那之前,您或其他任何人都无法做。

注意:我还注意到,如果您在简单项目的构建过程中使用默认配置,则可以正常工作。您的项目和构建可能有一些自定义,这是其他用户报告错误的地方。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。