How to build Visual Studio Installer Project in Azure Pipelines in Self-Hosted Windows Agent

820 views Asked by At

My project structure

The image above shows my Hello World project structure. I am trying to build the Setup-HelloWorld-x86.vdproj in Azure Pipeline in Self-Hosted Windows Agent (which is nothing but my local machine) by using the command line script task like shown in below image.

enter image description here

But I get the following error.

enter image description here

Kindly help me to build this Setup-HelloWorld-x86.vdproj

2

There are 2 answers

6
Vito Liu On

If you want to run the project via cmd devenv, you can refer to this doc.

As a workaround, you 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.

You can specify to build .sln or .vdproj to generate .msi file(s) in Task-mode option.

enter image description here

Update1

Thanks Tharunavignesh J for sharing.

The solution was to run the azure agent under proper account. Earlier my azure agent was running under some Network Service account, then I change it to the local account, then this cmd worked properly.

0
Lenard Bartha On

This other stack overflow link helped me get my visual studio installer project compiled with Azure DevOps pipelines. It is using yaml configuration instead of classic, but same steps / commands apply to both:

YAML Script for building Visual Studio Installer Projects using Azure DevOps

Basically the steps are:

  • Setup your variables to point to the tools
  • Download Nuget packages for your solution
  • Disable Out Of Process Builds command executed
  • Script task with the command line arguments to build your solution