I am loading the bindings section from configuration like so
var bingingsSection = BindingsSection.GetSection(ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None));
How can I determine if the configuration elements loaded came from the local application config file or if they came from the machine.config?
I found the correct answer on my own.
I need to inspect the
ElementInformation.Sourceproperty.Given the following config:
And the following application
Produces the output:
So as you can see the element defined in my local executable’s app.config shows the config path, however, the element I referenced that was not specified in the my local executable’s app.config returned a blank string. Presumably because it is the default.