Does web.config change all app.configs applications?

If I have a web application (with its own web.config) and the .dll that it uses has its own app.config, which settings file wins when there is a conflict?

+3
source share
2 answers

No, you will not have a conflict because the .dll cannot have its own .config file.

Even if you put the .config file for your library in the same folder, the application is simply not going to extract values ​​from it.

If you want to use some of these values, you can combine them into your web.config.

+6
source

web.config. , .

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>
+2

Source: https://habr.com/ru/post/1718176/


All Articles