Search code examples
msbuildjenkinsjenkins-plugins

Using Jenkins Version Environment Variable in the MSBuild step


I'm currently using the Jenkins "Version Number Plug-In" to set an Environment Variable for build version. This works fine within jenkins but i need a way to pass this to MSBuild so the Version Number of the exe's and dll's are updated. I tried the config bellow but it does not update the builds version

Version Number Config

Build Config


Solution

  • Environment Variable Name should be written without the percent-marks ('%'), like this:

    VERSION
    

    apart from that, I think you are good to go.

    May also consider changing
    ${BUILDS_ALL_TIME}
    to
    ${BUILDS_ALL_TIME, XX}

    (this will enforce a two-digit build-number with leading zeros)