Why dll assembly read AppSetting from its executable Config file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my app, an executable (app.exe) calls functions from an assembly dll
(subapp.dll).

app.exe has config file: app.exe.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="configVal" value="exe config" />
</appSettings>
</configuration>

and subapp.dll.config has config file: subapp.dll.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="configVal" value="dll config" />
</appSettings>
</configuration>

When ran the app, the dll got setting from the exe's config file
instead of its own config file.

Can you tell why and how to fix it?

Thanks
 
In my app, an executable (app.exe) calls functions from an assembly dll
(subapp.dll).
app.exe has config file: app.exe.config
and subapp.dll.config has config file: subapp.dll.config
When ran the app, the dll got setting from the exe's config file
instead of its own config file.
Can you tell why and how to fix it?

Why? Because that's the way it was designed to work!

You can only "fix" it by supplying your own logic to parse and
interpret the sub-assembly's .config file - no native .NET classes or
support for that in the system, sorry.

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Back
Top