I am developing custom toolbar and buttons for ArcMap 10.1 utilizing VS2010 and ArcObjects SDE 10.1 extensions. I put some application settings in the app.config file and I want to make them available in the runtime. When I execute

private static readonly string appSetting1 = System.Configuration.ConfigurationManager.AppSettings["appSetting1 "];

the value is null.

When I execute


the value is

"C:\Program Files (x86)\ArcGIS\Desktop10.1\bin\ArcMap.exe.Config"

Should I put my application settings is the ArcMap.exe.Config in order make them available to the ArcMap 10.1 custom toolbar or there is another way to do this? Thanks

  • 1
    There is not a way to reference settings in an app.config for your custom assembly. stackoverflow.com/questions/4889377/… Why do you need these settings in an app.config? Do you expect the user to be changing them or are they more constants?
    – Darlene
    Commented Aug 7, 2013 at 22:32
  • 1
    I was hoping to use the settings instead of hard-coding values in the .cs files. Things like illegal characters RegEx string; max number selected features allowed, etc. I have to recompile every time those change instead of changing just the app.config settings
    – mitaka
    Commented Aug 8, 2013 at 16:12

1 Answer 1


If you really need as assembly to have it's own config you directly load it using this .net code.

System.Configuration.ExeConfigurationFileMap fileMap = new System.Configuration.ExeConfigurationFileMap();
fileMap.ExeConfigFilename = "THE PATH TO THE CONFIG";
System.Configuration.Configuration cfg =
System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(fileMap, System.Configuration.ConfigurationUserLevel.None);

string thevalue=cfg.AppSettings.Settings[variable].Value;


Also you can look at these StackOverflow posts - https://stackoverflow.com/questions/53545/get-the-app-config-of-another-exe https://stackoverflow.com/questions/311253/config-files-for-assemblies-in-gac

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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