I can get the gitVersion now, and build up the version I want to use:
set gitVersion=%APPVEYOR_REPO_BRANCH:~-4%
set version=%gitVersion%.%APPVEYOR_BUILD_NUMBER%
The AppVeyorBuild can be updated with this,
appveyor UpdateBuild -Version %version%
But how to call the AssemblyVersion patch?
(I put the above commands in the build script)

#1 Posted by Feodor Fitsner Support staff on 05 Oct, 2015 04:25 PM
You can put those commands to
initsection of appveyor.yml (thus they run before git clone) and then just enable assembly patching declaratively.#2 Posted by bob.lokerse on 05 Oct, 2015 06:35 PM
Thanks!
I got it working:
General info, for others:
Now I have a dummy version in my AssemblyVersion.cs. I set the version in Sourcetree (GitFlow) when I create a release branch. For example: v1.2.
That version (1.2) with the appVeyor build number is used in Appveyor, the patched AssemblyVersion and in the nuget package for Octopus Deploy (which creates a Release based on the nuget package version).
#3 Posted by Feodor Fitsner Support staff on 05 Oct, 2015 11:31 PM
Cool, thanks for sharing the solution!
#4 Posted by george.polevoy on 21 Mar, 2016 06:32 PM
Is it possible do achieve the same in GUI mode, without using an ".yml" file in the repository?
What is the GUI equivalent of the init" section of an ".yml"?
I tried to pass the custom versioning script with the "clone script" parameter, but it turns out the clone script replaces cloning of the repository which is not what I want.
#5 Posted by Feodor Fitsner Support staff on 21 Mar, 2016 07:16 PM
"Init" script can be set on Environment tab of project settings.
-Feodor
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:04 AM.