3

I am trying to create a .msi installer package with wix for my dektop app in azure devops using yaml scripting. Below is the msbuild task created for the same:

- task: MSBuild@1
  inputs:
    solution: '**/*.wixproj'
#    platform: 'Any CPU'
    configuration: 'Release'
    msbuildArguments: '/p:Configuration=Release/p:ProductCode=${product_code} /p:UpgradeCode=${upgrade_code}/t:Clean;Rebuild'
    clean: true

Below is the error i'm getting during the pipeline build:

 Error MSB3441: Cannot get assembly name for "..\MyProject\bin\Release\MyProject.exe". Could not load file or assembly 'MyProject.exe' or one of its dependencies. The system cannot find the path specified.

Thanks in advance.

Rupal Goyal
  • 49
  • 1
  • 2

2 Answers2

2

We had this problem too. Our solution was to remove the Installer project from the Solution file, continue building the other projects in the solution using the standard MSBuild task and then add script tasks to the pipeline to generate the MSI:

pool:
  vmImage: windows-latest

steps:
    - script: .\Tools\Wix\candle.exe -nologo Foobar.wxs -out Foobar.wixobj -ext WixUIExtension
      displayName: 'Compile Wix file'
    
    - script: .\Tools\Wix\light.exe -nologo Foobar.wixobj -out Foobar.msi -ext WixUIExtension
      displayName: 'Create MSI file'

Note that our build is based on the windows-latest image which includes WiX Toolset; see the list of all included tools here.

fstarnaud
  • 335
  • 1
  • 12
0

I don't have custom arguments, so maybe that's the difference here, but I used the templated msbuild task that Azure Pipelines gives you. It produced the below yaml and it builds the msi just fine in the pipeline.

- task: MSBuild@1
  inputs:
    solution: '**/*.wixproj'
    msbuildArchitecture: 'x64'
    platform: 'x64'
    configuration: 'Release'
  displayName: 'build installer'
Travis
  • 1,044
  • 1
  • 17
  • 36