6

The version of a custom ArcGIS Pro SDK Add-In is held in the config.daml of the Add-In project:

<AddInInfo id="{some guid}" version="1.0" desktopVersion="1.1.3068">

How do I programmatically access the current version of the Add-In (without reading the xml file directly at runtime using an xmlreader)?

In the Add-In framework for ArcMap using ArcObjects SDK, the Add-In version could be accessed like so:

My.ThisAddIn.Version

Has anyone discovered the ArcGIS Pro SDK way of doing this? I would imagine it's possible but can't find the method or property to retrieve it.

I guess the version number is also held in AssemblyInfo.cs, but i'd rather use the value from config.daml.

4
  • 1
    Could you use the System.Reflection namespace? – Branco Sep 2 '15 at 15:34
  • @Branco I think this way will only retrieve the assembly version from assemblyinfo, which isn't really what I want (could be different from addin version). – pvdev Sep 2 '15 at 15:40
  • Maybe I haven't used add-ins enough, but I thought they were tied together. Past that, I am not sure. Did you cross post at GeoNet in case one of their engineers are surfing the forums? – Branco Sep 2 '15 at 15:42
  • @Branco I believe it's possible to have different versions for your addin and your assembly, I'll check. And yeah - i'll get this posted on geonet. – pvdev Sep 2 '15 at 15:44
1

It's too late. Still, I'm sharing this for newbies who still need help with this.

  var addInInfo = FrameworkApplication.GetAddInInfos().First(addIn => addIn.Name == "your addin name");
  var version = addInInfo.Version;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.