[Solved] App.config problem


The best you can achieve is to have two separate configuration files, then have the code of one method read the “main” config file (using the ordinary ConfigurationManager.AppSetting[""] code) and other method read the configuration file of the class library using such code:

Configuration config = ConfigurationManager.OpenExeConfiguration(dllFilePath);
KeyValueConfigurationElement element = config.AppSettings.Settings[appSettingKey];
string value = element.Value;

This will read application setting from the config file of DLL sitting in the location of dllFilePath.

You can also have separate section for the class library in the “main” configuration file if relevant I can give sample as well.

solved App.config problem