Way to reference the assembly version in a deployment

chris's Avatar

chris

29 Jun, 2015 04:57 PM

Is there a way to reference the actual assembly version in a deployment? I've tried $(assembly_version), but that did not produce a result. I know I can reference other environment variables like the appveyor build version, but in my case this would differ from the assembly version. The deployment I'm using is Github Releases.

  1. Support Staff 1 Posted by Feodor Fitsner on 30 Jun, 2015 12:46 AM

    Feodor Fitsner's Avatar

    There is no such functionality built in, but as an idea you can have a simple PowerShell line using Assembly class to load assembly and read its version.

    - Feodor

  2. 2 Posted by chris on 30 Jun, 2015 02:15 PM

    chris's Avatar

    Thanks for pointing me in the right direction. This seems to cover it pretty well http://stackoverflow.com/questions/3267009/get-file-version-and-ass... .... and then this discussion seems to cover the rest http://help.appveyor.com/discussions/questions/1353-semantic-versio... .

  3. 3 Posted by chris on 30 Jun, 2015 02:45 PM

    chris's Avatar

    my final after-build script for those interested:

    $exists = Test-Path "src/myProject/bin/Release/myProject.dll"
    If($exists)
    {
        $aav  = ls src/myProject/bin/Release/myProject.dll | % versioninfo
        Set-AppveyorBuildVariable -Name "my_assembly_version" -Value $aav.ProductVersion
    }
    

    And then simply reference the $(my_assembly_version) variable in both the Tag and Release name text boxes. Thanks again for the help!

  4. Support Staff 4 Posted by Feodor Fitsner on 30 Jun, 2015 03:00 PM

    Feodor Fitsner's Avatar

    Elegant solution! Thanks for sharing it.

  5. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:57 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac