简体   繁体   中英

App.config and ConfigurationManager

If I call the OpenMappedExeConfiguration() method and specify a config file (filemap) as a parameter, does this mean that the ConfigurationManager will use the newly specified config file from that point onwards and ignore app.config?

I know that ConfigurationManager looks for app.config by default, but because the OpenMappedExeConfiguration() method returns a Configuration object, its almost as if the instance returned is the only applicable to the config file specified, but I'm not 100% sure.

As far as I remember it will just open the configuration and return the Configuration object, its not going to change the default one.

use this as parameter to call current config open AppDomain.CurrentDomain.SetupInformation.ConfigurationFile can also use this in messagebox to show config file in use

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM