5

I have recently upgraded some of our windows application to VS2019 and created the setup project using VSInstallerProject extension in VS2019 . What I noticed is setup is not getting created when the Release pipeline is run , but I need the msi (or exe) files here so I can use the same to install on app server .

I have made changes in my pipeline and added a task : 'DutchWorkz - Build VS Installer(s)' in the release pipeline . I have attached the logs of the error I am getting at this task in Azure Devops below . Build is getting failed at this task .

Can anyone guide me on what the issue here is and how can I resolve it ? Also , I want to create the setup projects/msi in VS2019 , but I don't see Vs2019 option in this task, how can I use this task in VS2019 version .I have Vs2019 installed on agent server .

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).

I have tried using devenv command line too , inorder to build the setup project .I have tried it with both the vs2017 (professional) and vs 2019(enterprise) and I am getting issue in both .While issue with 2017 is about license , I am not able to figure out what's causing the issue for 2019 . Please let me know if you have any thoughts on what could possibly be causing this issue and how can this be resolved . The goal is offcourse to build the setup project with azure devops pipeline and use the generated msi file for installation on app server . Thanks in advance .

Here's the screenshot for new build and issue : new build def issue with 2019 issue with 2017

Build agent server has Vs installer already installed , pls see if this is okay : vsinstaller

Please check the new logs from 'command line task' below :

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://learn.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

Here's the additional error log :

additional log

EVEN though the command line task passed , the .vdproj setup project didn't get updated or build . I can see that from timestamp , all other projects getting updated as usual .

Raq
  • 433
  • 1
  • 7
  • 20

2 Answers2

2

I found a similar ticket you can refer to it.

Configure self-hosted agent and make sure the VS Installer Projects extension is installed on your own build agent and then you can build the setup project either use command line task with "devenv" or use the "Build VS Installer" task.

If you get the error like 8000000A, you can follow the instruction here to configure your self-hosted agent: Solution: An error occurred while validating. HRESULT = '8000000A'.

By the way, since this extension is developed by a third party. You can connect the extension owner to get the detail info

Update1

We can install the extension Build VS Installer and use the task DutchWorkz - Build VS Installer(s) to build Visual Studio Installer Project in Azure Pipelines.

enter image description here

Vito Liu
  • 7,525
  • 1
  • 8
  • 17
  • Hi Vito , Thanks for your comment . I also tried using devenv command as given in the link you shared . I have tried it with both Vs 2017(professional) and 2019 (enterprise) present on my build agent server . While error occurred wile using 2017 is about license , I didn't get what caused the issue when using 2019 . I have updated the original post with the details . Please let me know what could cause such issue . Thanks in Advance – Raq Sep 22 '20 at 14:51
  • Hi @RehanHaque, Could you please run the cmd on the local machine and kindly share the result here? In addition, I cannot reproduce this issue on my side, please set the variable system.debug to true and share the full log here, I will check it and help you. Thanks – Vito Liu Sep 25 '20 at 09:52
  • HI , When I ran the build with debug true , I realize that it was no getting the .sln path , so I have added the full path and the task is not failing anymore (using vs2019 here) . But when I checked the build agent server , I still don't see the setup project getting build , while other projects aer getting updated (which is happening even without devenv command , happening with the build task) . i have attached the new logs , screenshot from build agent server . Please check and revert your comments . Thanks ! – Raq Sep 26 '20 at 16:08
  • Hi @RehanHaque, I'm sorry to reply to you so late. Please check the update1 and then kindly share the result here. – Vito Liu Oct 08 '20 at 08:59
0

I looked at the package you mentioned, at this location - https://marketplace.visualstudio.com/items?itemName=dutchworkz.BuildInstaller&ssr=false#review-details

If you go there and look at the comments other users have left behind, the error is something that is present as part of the build process. The original developer has not fixed it.

At the same, just like the users have mentioned, you are able to see the msi installer and use it. So, you are (I am assuming) getting what you need, the installer.

My best suggestion is, since you are getting what you need, ignore the error and wait till the developer fixes this issue. Until then, there is nothing you or anybody else can do about it.

Note : I also noticed that if you are using the default configuration during the build process for simple projects, it works fine. Your project and build may have some customization which is where other users have reported errors.

Jay
  • 2,648
  • 4
  • 29
  • 58
  • Thanks Jay , I think they hav not released a version for VS2019 . The error I have mentioned is occurring when I am using it in VS2017 settings . I needed the msi files to be generated with the build so I can use the same to install application on application server , but currently that's not getting generated . All I see in setup project is .vdproj file . So ,this is pretty much a issue for me now. – Raq Sep 22 '20 at 08:18
  • See, that is the thing. you are using an extension which is 3rd party. It has about 30 reviews so perhaps it is not very popular. your best option would be contact the developer, but it is a free extension so not sure about fast support. Or, try another method. Last Resort, you may have to do this part manually from visual studio itself. I am putting myself in your position and trying to imagine what are the things i would try. – Jay Sep 22 '20 at 08:23
  • Now I am doing the same creating the setup from local machine . But I think going forward I would definitely need this to happen with pipeline itself . Any other way to generate msi files from .vdproj from azure pipeline ? – Raq Sep 22 '20 at 08:58
  • from what I understand, focus in azure devops has shifted to msix, which is the newer format of packaging. You are using an older version, which frankly, no, i dont think you will find many details except for extension like the one you are already using. ultimately, your best option would be build an extension like code, all by yourself to do this. devops has a lot of benefits but you are essentially doing a legacy thing. – Jay Sep 22 '20 at 09:02
  • so, if you can shift to msix, i think, your path will become a little easier. but you are married to msi, due to work reasons or personal reasons, then, sorry man, you have a tough, solo road ahead. – Jay Sep 22 '20 at 09:02
  • It appears that Dutchworz has unpublished this from the marketplace. It is no longer an option. – Joe Kampf Jun 14 '21 at 14:36