Select to view content in your preferred language

Add-in cache directory

3372
1
10-15-2010 12:03 PM
DarinKwasniewski
New Contributor
Utilizing C# is it possible to access the cache directory from code. i.e. I wish to deploy a data file with the eaz and be able to retrieve it during runtime, therefore I need to get the path. (I would prefer not to build the data file as a resource).
0 Kudos
1 Reply
MichaelBranscomb
Esri Frequent Contributor
Hi,

There was a blog post on bundling files with Add-ins - which uses the 'Content' build action: http://blogs.esri.com/Info/blogs/arcgisexplorerblog/archive/2009/09/17/tip-for-add-in-developers-how....

However, the cache folder is within the Add-ins folder under the user profile - e.g. C:\Users\mbranscomb\AppData\Roaming\ESRI\arcgis explorer\Addins\Cache. Therefore you can get to this location in .NET:

e.g.

The following code:

string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

Returns:

"C:\\Users\\mbranscomb\\AppData\\Roaming"

Regards

Mike
0 Kudos