Hi Sam,
Sorry I should have clarified a bit more when I said "a solution which
consists of multiple projects". Your guess is correct. What I thought is
that if I can use each app.config for each of my class lib project, then the
code would look much cleaner and readable. But most importantly, if someone
in development team wants to use this project in the future, he wouldn't
have to spend time look for the keys. Thanks so lot for your help.
Regards,
another Sam
"sam.m.gardiner" <sa************@gmail.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
By "a solution which consists of multiple projects" I guess you mean
multiple class libraries. Any App.config file added to a class lib
won't get "built" to the output directory
in the same way that it does when added to a console or windows
application (at least this is true in .net 1.1, I don't know about .net
2.0)
If you want to have multiple config files then you will need to write
custom code for this and make sure that the configuration files get
copied to the right place at build time.
I have done something similar and have used NAnt to rename and copy the
app.config files and then used custom code to read from the xml config
files. However, there is a lot of clever stuff about config files in
.NET 2.0 that might be useful.