Sign up ×
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.

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
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
@user4979: you might want to check out this question if you are looking at adding user scoped settings:… – Jay Cummins Nov 30 '11 at 21:51
@blah238 user4979 has not been seen here for over 3 years, and I do not have the knowledge to translate their (and/or your) comment into an answer. Could you perhaps do so sometime? – PolyGeo Feb 15 at 1:46
@PolyGeo It was not an answer, just a suggestion. – blah238 Feb 15 at 15:01

2 Answers 2

Here is the C# code to get the addin assembly folder:

public static string AssemblyDirectory
                string codeBase = Assembly.GetExecutingAssembly().CodeBase;
                UriBuilder uri = new UriBuilder(codeBase);
                string path = Uri.UnescapeDataString(uri.Path);
                return Path.GetDirectoryName(path);

and VB.NET:

Public Shared ReadOnly Property AssemblyDirectory() As String
        Dim codeBase As String = Assembly.GetExecutingAssembly().CodeBase
        Dim uri__1 As New UriBuilder(codeBase)
        Dim path__2 As String = Uri.UnescapeDataString(uri__1.Path)
        Return Path.GetDirectoryName(path__2)
    End Get
End Property
share|improve this answer

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

import os
print os.path.dirname(__file__)
share|improve this answer
Python add-ins did not appear until ArcGIS 10.1 for Desktop and this is a 10.0 question so the type of add-ins involved are described at… – PolyGeo Feb 15 at 1:43

Your Answer


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.