How to access data located inside the installation location of an Add-in?

3648
1
Jump to solution
03-25-2015 11:43 AM
KeithPower1
New Contributor

I am creating an Add-in for ArcMap 10.2 using C#.NET.  Documentation for Python Add-ins says you can access the data located inside the installation location using the __file__ built-in function.

How do I access this location in .NET?  I know the location is "C:\Users\<username>\AppData\Local\ESRI\Desktop10.0\AssemblyCache" but that isn't very helpful since I don't know the username.

Thanks,

Keith

0 Kudos
1 Solution

Accepted Solutions
FreddieGibson
Regular Contributor II

If you embed the data in the project you can get the path to it in C# starting with System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location). this will give you the path to where the addin data is extracted on the machine within the AssemblyCache folder.

View solution in original post

1 Reply
FreddieGibson
Regular Contributor II

If you embed the data in the project you can get the path to it in C# starting with System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location). this will give you the path to where the addin data is extracted on the machine within the AssemblyCache folder.

View solution in original post