views:

1287

answers:

1

Hi,

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.

+2  A: 

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

Grzenio
I believe that is correct - this gives you a handle to read config from a configuration file explicitly, it does not change the in-memory configuration used by the process.
Yossi Dahan