Select to view content in your preferred language

Where is the location for Add-in Configuration settings?

5339
3
07-28-2012 12:02 PM
RyanSutcliffe
Frequent Contributor
I am developing an an Add-In for ArcMap using VB that makes use of user application settings. This way the user can add their own file paths via the configuration file ([my addin name].dll.config). I'm pretty new to VB development but I've got it working fine happily. What is still perplexing me is where to find the updated configuration file. I've built the application and updated the file path. It saves and returns the updated values even after I close and reopen ArcMap.

I looked at the .dll.config file under the add-ins assembly cache here:
C:\Users\rsutcliffe\AppData\Local\ESRI\Desktop10.0\AssemblyCache\{D75DBAEC-8872-6159-2182-9564B6D8467D}

And the .dll.config file in the .esriAddin file here:
C:\Users\rsutcliffe\Documents\ArcGIS\AddIns\Desktop10.0\{02ebc0ad-684f-4f98-af17-d7248f56652c}

Yet, both still show the old settings. Where are my new file path values being saved? It would be good to know this just so that I can swap in different settings without having to manually type them in via my add-in form in ArcMap.

- Ryan
Canada
0 Kudos
3 Replies
LeoDonahue
Deactivated User
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#Well

I'm not a .NET guy, but in Java, Add-ins are really just zip files with another extension name. 

If I wanted to create a properties file with name/value pairs that would allow my Add-in to be configured without a recompile, I would probably opt to place that properties file somewhere in a defined directory, like the user's home directory or some other defined place for the Add-in but not in the directory where Add-ins are deployed. 

Otherwise, my end user would have to unzip the Add-in, get into the properties file, update stuff, convert the zip file back to an add-in, restart ArcMap, etc.  Sounds messy.
0 Kudos
RyanSutcliffe
Frequent Contributor
Thanks Leo, its true that using the .config file is not a good way to manage settings manually. If this is something that needs doing regularly I'll make a custom xml file instead. But really I'm just curious-- if I update settings in my Add-In application where is the xml file where these settings are being saved? Any ideas or suggestions are welcome.

Ryan
0 Kudos
LeoDonahue
Deactivated User
I don't know where the config files are stored for .NET Add-ins, other than referencing the link I provided.  With Java add-ins, you can rename the add-in file to .zip and see how it is bundled together.

[ATTACH=CONFIG]16794[/ATTACH]

So if I were going to create a properties file or xml file to store application settings, I would choose a location such as the user's home directory, or some other directory for this specific add-in.  While it would be nice to use the classpath of this add-in, making the change for me would require the end user needing to rename the add-in to .zip, extract it, change the settings, rezip it, rename it to .esriaddin

One mistake and you're stuck (as the end user).
0 Kudos