How to store custom application settings globally?

695
2
09-20-2019 03:24 AM
MaximilianGlas
Esri Contributor

Hi,

For my ArcGIS Pro configuration where I strip down the application, there is a need to store my custom application settings. But I do not want to store it in a project (as these settings are needed right before loading a project, I need them in the startup page) and I do not want to store it for each user (because the application should use the settings the same way for each user).

In the documentation I could only find described the way to store project settings and user settings, but no way to store application settings. In my opinion, this is a gap.

I even tried to use the app.config in my Visual Studio Project, but I the values are only stored while runtime, when relaunching the appilication, I get the default settings.

What is your recommendation for storing settings in a global context when using a configuration?

Kind regards,

Max

2 Replies
MaximilianGlas
Esri Contributor

Hi,

I've been looking into this a little bit more.
In generel my storing mechanism worked, the only problem is that the DLLs and therefore the Config are located in a temporary directory at runtime and are changed there as well.
If the application is started a second time, a new temporary directory is apparently created and the previously saved settings are therefore not available.

I have now helped myself by writing my own small application that reads the proConfigX file, changes the settings inside it and saves them back.

This is not optimal either, because you have to reinstall the extensions every time you change the settings, but it seemed to me to be the best solution so far.

Kind regards,

Max

artifact
New Contributor III

Two years later and this is still an issue. It is mind blowing that ESRI has not only failed to implement some form of Application level settings, but also broke app.config in the process.