If I have a web application (with its own web.config
) and a .dll it uses happens to have its own app.config
which settings file wins when there is a conflict?
No, you will not have any conflict because a .dll cannot have its own .config file.
Even if you put a .config file for your library in the same folder, the application is simply not going to pick up the values from it.
If you wish to use some of those values, you can merge them into your web.config.
You can merge settings from another configuration file into your web.config file. This also allows you to override values aswell if they have the same key.
web.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings file="YourSettings.config">
<add key="KeyToOverride" value="Original" />
<add key="KeyToNotOverride" value="Standard" />
</appSettings>
...
YourSettings.config
<appSettings>
<add key="KeyToOverride" value="Overridden" />
<add key="KeyToBeAdded" value="EntirelyNew" />
</appSettings>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With