Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I see that my add-ins are installed to C:\Users\Me\AppData\Local\ESRI\Desktop10.0\AssemblyCache{6C90269B-D233-4122-3747-C2AE1131E22C} Is it possible to find that file path from within the Add-in itself? e.g., someone would click a button and it would tell them the path where the add-in is located. I want to use this location to store user-defined configuration info. Thanks!!!

share|improve this question
    
won't let me post my own answer yet, so here it is: This returns full path to the .dll Public Function FindMe() As String FindMe = System.Reflection.Assembly.GetExecutingAssembly().Location ' MsgBox(FindMe) return FindMe End Function –  user4979 Nov 30 '11 at 19:04
2  
You might consider creating a well-known folder under %APPDATA% to store user configuration data rather than in the AssemblyCache folder as this is subject to deletion by the add-in framework and as you have seen requires reflection to determine. –  blah238 Nov 30 '11 at 20:30
1  
@user4979: you might want to check out this question if you are looking at adding user scoped settings: gis.stackexchange.com/questions/9001/… –  Jay Cummins Nov 30 '11 at 21:51

1 Answer 1

If you are using Python, you can find the folder location by doing the following

import os
print os.path.dirname(__file__)

Enjoy

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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