In our automatic build we use MSBuild in combination with web.config transformation to create an acceptance config and a production config.
We have added attributes to change config settings
for example to change the cdn url's.
<add key="cdn1url" value="http://cdn.acceptance.oursite.com/"
xdt:Transform="SetAttributes"
xdt:Locator="Match(key)" />
Does anybody know if it is possible to add an autoincrement attribute? We want to add +1 to the version attribute (for css/img/js caching) on every production build.
An other option could be the Teamcity build number, but I am not sure if that is possible
3PS at the bottom and then back to 3 <FileUpdate
Files="@(FilesToUpdate)"
Regex="regex here"
ReplacementText="$(NextVersionNumber)" />
PS: By using RegexMatch task you can extract current version and then by incrementing it you'll get a value for the $(NextVersionNumber) proeprty.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With