This article shows 2 approaches to implement a tool to auto-increment the version number of your add-in.
Both approaches achieve the same result and your choice will mostly depend on preferences.
Executable based (C#) Solution
The attached Zip file, UpdateAddInVersion.zip, contains a Visual Studio 2022 solution with the source code for a tool that auto-increments your add-In's version number. This tool updates the last element of the version attribute in the config.daml file every time you build your project.
For example:
It is designed to work with Module Add-Ins and Managed Configuration that include a config.daml file.
Setup Instructions
Step 1: Download the attached Visual Studio solution Zip file (UpdateAddInVersion.zip)
Step 2: Unzip it somewhere convenient.
Step 3: Open the solution in Visual Studio 2022 and build it
Step 4: Copy all files from the build folder (bin\Debug\net8.0) into a sub directory of the Add-In you want processed. A good convention is to use a folder called BuildTools.
Step 5: Create a “Post-Build event” in your AddIn or Configuration project to run this tool to edit the version attribute in your add-in’s config.daml. Follow these steps to create the post build event:
On a successful build, the post build call will auto-increment the last element of the version attribute in the config.daml: so version=”1.0” becomes version=”1.1” and version=”1.0.0” becomes version=”1.0.1”. It will update the last element of the version, no matter how many elements the version has.
Notes:
MSBuild script solution
The attached AddInVersionTargets.zip file contains a MSBuild script to auto-increments your add-In's version number. By default, this tool updates the minor build number element of the version attribute in the config.daml file every time you build your project so version="1.0" becomes version="1.1".
Setup Instructions
Step 1: Download the attached AddInVersionTargets.zip file
Step 2: Unzip it somewhere convenient (i.e.: C:\BuildTools).
Step 3: Edit your Add-in project file to reference it: right-click on your add-in project and select Edit Project File in the context menu:
At the bottom of the project file, right before the ArcGIS Pro SDK targets import statement, insert the following line:
<Import Project="C:\BuildTools\AddInVersion.targets"/>
Notes:
This can be achieved by editing the AddInVersion.targets file to add an IndexElement parameter with the appropriate target element (revision in this example):
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.