ConfigurationManager.OpenExeConfiguration – loads the wrong file?

I can’t remember where I found this solution but here is how I managed to load a specific exe configuration file:

ExeConfigurationFileMap map = new ExeConfigurationFileMap { ExeConfigFilename = "EXECONFIG_PATH" };
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);

Leave a Comment