Trouble with trying to build a .msi installer with a .vdproj file in Azure DevOps pipeline with cmd line and devenv

Viewed 21

Thank you for the help!

I am trying to build a .msi installer with a .vdproj file in Azure Pipelines, Microsoft hosted.

I am using a cmd line and devenv as other guides and people have suggested, but it seems to just run for a very long time at my 'Build MyApp Installer' step, about 39mins until I cancelled the run since it didn't seem like it was doing anything.

What am I doing wrong? Please help, and thank you again!

enter image description here


trigger:
- master

pool:
  vmImage: windows-latest

variables:
  solution: '**/*MyApp.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
  installerProject: '**/*MyApp_Installer.vdproj'
  disableToolPath: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild'
  visualStudioPath: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise'

steps:

  - task: UseDotNet@2
    displayName: 'Use .NET SDK 6.x'
    inputs:
      packageType: sdk
      version: '6.x'

  - task: DotNetCoreCLI@2
    displayName: 'Restore Project Dependencies - DotNet'
    inputs:
      command: 'restore'
      projects: '**/*.csproj'

  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.10'
    displayName: 'Use Python 3.10'

  - script: |
      python -m pip install --upgrade pip setuptools wheel
      pip install numpy
      pip install pytest-azurepipelines
      pip install pywinauto
      pip install pytest-cov
    displayName: 'Install Python Dependencies'

  - task: CmdLine@2
    displayName: 'Prepare for MSI Build'
    inputs:
      script: 'DisableOutOfProcBuild.exe'
      workingDirectory: $(disableToolPath)

  - task: VSBuild@1
    displayName: 'Build Primary Project'
    inputs:
      solution: '$(solution)'
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'

  - task: CmdLine@2
    displayName: 'Build MyApp Installer'
    inputs:
      script: '"$(visualStudioPath)\Common7\IDE\devenv.com" "MyApp\MyApp.sln" /Project "Alpha\MyApp_Installer\MyApp_Installer.vdproj"'
1 Answers

I was able to build the .msi file by removing the .sln from the script:

  - task: CmdLine@2
    displayName: 'Build MyApp Installer'
    inputs:
      script: '"$(visualStudioPath)\Common7\IDE\devenv.com""Alpha\MyApp_Installer\MyApp_Installer.vdproj" /Rebuild "Release"'
Related