Where to put App.config
View Single Post
Thanks for Peter's input.
As Peter has mentioned, for .net application, the config file(app.config or
web.config) is only available at application level(winform ,console or
asp.net applications....). And the app.config file in Class library project
is just used to simulate the app.config or web.config file in concrete
application, so that we can convenient write code to accessing config file
elements or let the IDE conveniently generate some content for components
in app.config file.
When you want to reference a certain class library in your application, if
you need to also use those settings in the class library's app.config (or
update them), you need to copy the certain configuration sections in the
class librray's app.config into the concrete application's application
config file (app.config or web.config). Thus, when using in the
application, the class library will read those setting from the
application's app.config or web.config file...
Microsoft Online Support
(This posting is provided "AS IS", with no warranties, and confers no