Razor
Razor

Reputation: 17498

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.

Upvotes: 3

Views: 3695

Answers (2)

Jed I
Jed I

Reputation: 1018

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

Upvotes: 0

Grzenio
Grzenio

Reputation: 36639

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

Upvotes: 2

Related Questions