BMuuN / vsts-assemblyinfo-task

Assembly Info is an extension for Azure DevOps that populates assembly information metadata from a build pipeline.
https://marketplace.visualstudio.com/items?itemName=bleddynrichards.Assembly-Info-Task
MIT License
44 stars 27 forks source link

How to set version number to an Installer.vdproj file? #284

Closed kngwin9 closed 1 year ago

kngwin9 commented 2 years ago

Hello and thank you for taking the time to review my issue.

First off, I am task and adding versioning works fine when I test on my .csproj file.

Currently, I am trying to use the task"Assembly-Info-NetCore@3" (please see below for yaml) to add the build/version to an installer's (Installer.vdproj) versioning that I am building in the pipeline.

I'm running in to an issue where the only file extensions supported are .csproj, .vbproj, .props:

  - task: Assembly-Info-NetCore@3
    displayName: 'Set Assembly Metadata For Installer'
    inputs:
      Path: '$(Build.SourcesDirectory)'
      FileNames: '**/*Installer.vdproj'
      InsertAttributes: true
      FileEncoding: 'utf-8'
      WriteBOM: true
      FailOnWarning: true
      Company: 'kngwin9'
      Copyright: 'Copyright © $(date:YYYY) kngwin9'
      PackageVersion: '$(Build.Buildnumber)'
      UpdateBuildNumber: 'v$(Build.Buildnumber)'
      AddBuildTag: 'v$(Build.Buildnumber)'
##[error]Invalid file.  Only the following file extensions are supported: .csproj, .vbproj, .props

Is there any way to still add the versioning to the Installer.vdproj or a way around this? or what would be the best way to handle this?

Apologies, I'm new to all of this, thank you again for your time, help, and reply.

BMuuN commented 1 year ago

Hey @kngwin9 thanks for taking the time to leave a detailed issue unfortunately the task does not support installer projects and there's currently no scope for adding this functionality into the task.

The task does output the version numbers as variables so you could use a token replace task to populate the *.vdproj using the output variables. Hope this helps.