Obtain version from config.daml programmatically

664
2
Jump to solution
01-13-2022 06:27 AM
Jean-SébastienRoy
New Contributor II

I'm building an arcgis 2.6 configuration to add buttons to the UI with a custom window that appears on click. This is not an AddIn, nor does it shows in the AddInManager in Pro (this is the wanted behavior).

In the config.daml we can specify the version : 

 

 

<AddInInfo id="{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX}" version="2.1.1" desktopVersion="2.6">

 

 

If it was a regular addin I could use the solution provided here (c# - Programmatically fetching current Add-In version using ArcGIS Pro SDK - Geographic Information ...), that is using 

FrameworkApplication.GetAddInInfos().First(addIn => addIn.Name == "your addin name").Version

But in my case, not being an addin, it does not work.

We are temporarily using the version from the file AssemblyInfo.cs through Assembly.GetExecutingAssembly().GetName().Version but as we also have addins in the same project and their version comes from the first solution (in the .daml), we wanted to keep the source for the version number the same everywhere.

Is there any way to access the combined config.daml info from within the viewmodel of the UI window we display after the button click?

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

There is ArcGIS Pro SDK sample, You can find it here:

https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Content/AddInInfoManager 

Class AddIn has all you need

View solution in original post

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

There is ArcGIS Pro SDK sample, You can find it here:

https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Content/AddInInfoManager 

Class AddIn has all you need

0 Kudos
Jean-SébastienRoy
New Contributor II

Thanks, I also think that this should be the only way, too complicated for the need we have, I'll keep using the alternative, aka using the Assembly version. I might actually do the opposite, so switch everything to the assembly version instead of the addin version. thanks!

0 Kudos