This may be the simple question to answer, but I am struggling to resolve.
I have Web.config
with the following values in my Web Application.
You have to merge both configuration sections and place all settings in the main configuration file of your application. In case of the web applciation it would be the web.config
.
While I don't work often with web applications, in my desktop application I often face a similar issue. I've been using the code provided by Daniel Hilgarth https://stackoverflow.com/a/6151688/2212458 to temporarily switch configuration files. The plugin loader can pull in the plugin configuration file and then restore its own.
The short answer is: you can't. The application using your library won't pay any attention to your app.config
. You could use a settings
file instead or perhaps go a longer way around, abstract out the configuration manager and have it programmatically read your app.config
as an XML file in the application's output directory in order to include its settings. Understandably, neither option is ideal.