How to call the AssemblyVersion Patch, from the build script
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)
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

Support Staff 1 Posted by Feodor Fitsner 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).
Support Staff 3 Posted by Feodor Fitsner 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.
Support Staff 5 Posted by Feodor Fitsner 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.