TeamCity CI has a variable %system.build.number%
which will be incremented in the format 1.0.%build.counter%.0
. This will generate assemblies with different version number each time. I want to add this new version number in my app.config file. Whats the easiest way to do this. I have 100 projects which have app.config and mostly all use the same assemblies. Can I have a common app.config file which I can link and modify it. Well, please provide a example of how to modify the newVersion
field in the binding redirect to the current build number provided by teamcity using a XmlTransform.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<legacyUnhandledExceptionPolicy enabled="1" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="MyApp.Data.Model" publicKeyToken="866d4a0fa0594321" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.1.0" newVersion="1.0.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>