Reputation: 3668
I want to update the version number of my .exe file using Update Assembly Info plugin. I am using the following configuration:
But, I keep getting an error
'$(Date:yyyy.MM.dd)$(Rev:.r)' is not a valid parameter for attribute 'AssemblyVersion'
Upvotes: 1
Views: 1786
Reputation: 33698
The $(Date:yyyy.MM.dd)
and $(Rev:.r)
can’t be used as the build-in variable, it can be used in Build number format (Options tab).
The workaround is that:
$(date:yyyyMMdd)$(rev:.r)
-bn $(Build.BuildNumber
)Script:
param(
[string]$bn
)
$d=Get-Date -Format "yyyyMMdd"
$r=$bn.split("{.}")[-1]
Write-Host "##vso[task.setvariable variable=currentVersion]$d$r"
currentVersion
variable in subsequent tasks, such as Update Assembly task.Upvotes: 2