Friday, April 8, 2011

App.config and ConfigurationManager

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.

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

    Yossi Dahan : 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.

0 comments:

Post a Comment