tag:help.appveyor.com,2012-11-13:/discussions/problems/25857-assembly-info-patchingAppVeyor: Discussion 2020-01-10T09:21:09Ztag:help.appveyor.com,2012-11-13:Comment/479822612020-01-09T04:35:25Z2020-01-09T04:35:25Zassembly info patching<div><p>Hi Cedd,</p>
<p>Take a look at this section about build versioning: <a href="https://www.appveyor.com/docs/build-configuration/#build-versioning">https://www.appveyor.com/docs/build-configuration/#build-versioning</a></p>
<p>For semantic versioning you may want to look at GitVersion: <a href="https://github.com/GitTools/GitVersion">https://github.com/GitTools/GitVersion</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/479822612020-01-09T10:49:17Z2020-01-09T10:49:18Zassembly info patching<div><p>Cool, so the assemblyinfo patching version (<code>{version}</code>), can be specified in the appveyor.yml with:</p>
<pre>
<code class="yaml">version: '1.0.{build}'
<pre><code>
And if I wanted to use GitVersion, how would I set `{version}`? I think it is an environment variable, so could I set that in init, assuming that init happens before the assembly patching?</code>
</pre></code>
</pre></div>ceddtag:help.appveyor.com,2012-11-13:Comment/479822612020-01-09T18:17:08Z2020-01-09T18:17:08Zassembly info patching<div><p>In the version format expression you can use any environment variable. Therefore you can define a new variable with version during <code>install</code> phase which runs <em>after</em> clone and <em>before</em> assembly patching, example pseudo-yaml:</p>
<pre>
<code>install:
- GitVersion ...
- ps: $env:MY_VERSION = ...
assembly_info:
patch: true
assembly_version: '${MY_VERSION}'</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/479822612020-01-10T09:21:08Z2020-01-10T09:21:08Zassembly info patching<div><p>Thanks feodor, thats very helpful ...</p></div>cedd