Hey All,
I have managed to create an add-in for ArcGIS Pro 3.1 that I'm ready to deploy to my user base. My add-in calls a python GeoProcessing tool which is in my AddIn.esriAddinX file. The problem is my code can't find it. I ran across something awhile back that suggested I do something like this:
string here = System.IO.Directory.GetCurrentDirectory();
string script = System.IO.Path.Combine(here, @"Toolboxes\Tools.atbx\BuildGeoPackage");
This worked great while building and running the Debug configuration. Now though, when building for Release, it doesn't work. The "here" string references the user's Desktop folder but the add-in is in Documents\ArcGIS\AddIns\ArcGISPro\{uuid}\AddIn.esriAddinX.
How do I get the actual install folder and then once there how do I peek into the .esriAddinX file?
Solved! Go to Solution.
This appears to work for both Debug and Release:
string here = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
That is a nice idea but, for a couple of reasons I won't go into here, I can't do that.
This appears to work for both Debug and Release:
string here = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);