I am accessing my assembly's configuration like this:
ExeConfigurationFileMap map = new ExeConfigurationFileMap();
map.ExeConfigFilename = Assembly.GetExecutingAssembly().Location + ".config";
Configuration conf = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
AppSettingsSection appSettings = conf.AppSettings;
My .config file contains a section like this
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CsDll.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="CsDll.Properties.Settings.SabreCAD" connectionString="A Connection string." />
<add name="CsDll.Properties.Settings.StpParts" connectionString="Another connection string" />
</connectionStrings>
<applicationSettings>
<CsDll.Properties.Settings>
<setting name="StpInsertSearchPath" serializeAs="Xml">
<value>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>A string</string>
<string>Another string in the collection</string>
I can successfully read the connection strings including changes if I edit the .config file. So, I know I am connected to the correct file. But I cannot find that string collection inside of the appSettings object. It is is not in the .Settings KeyValueConfigurationCollection. Where do I find my string collection?