I need to read/write to an exe.config file without knowing before-hand what settings the file has. I am using the AppSettingsSection class, but the Settings collection is empty when the exe.config actually contains about 20 user settings. Here is the code I am using to access the application settings
string path = @"C:\Projects\App1.exe";
Configuration config = ConfigurationManager.OpenExeConfiguration(path);
AppSettingsSection appSettingSection = config.AppSettings;
It gets the config but the appSettingSection.Settings is empty when it really should have about 20 items. Am I missing something or is this not possible?