hi there,
i'm building a small class library which will be used from classic asp
(com interop), asp.net and for testing purposes from my console test
application. the class library requires an app.config which i have
created. a couple of settings are added to it.
now my problem: in my console test application i've added a reference
to the class library. everything works fine except that the class
library doesn't read the configuration settings as i would expect. the
values read using the ConfigurationManager.AppSettings["MySetting"]
method always return null strings. i've been working with app.config
files before and it always worked fine.
i guess this might have to do with the hierarchy of configuration
settings. i guess, if i would add the configuration file to the console
app instead of adding it to the class library, everything would work
fine. but this is not what i need. i need the configuration to be
attached to the class library. does this have anything to do with
installing the class library in the gac? do i need to do that? and if
so, how do i do that?
thanks for reading thus far. i hope i explained the problem properly.
my english is not the best. any help is greatly appreciated.
--
Peter Bromberg [C# MVP] - 19 Mar 2008 14:35 GMT
".dll" assemblies do not normally read a configuration file. You should put
your settings in a config file named <myExeName>.exe.config. The executable
will then read your settings which may easily be passed to the class library.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
> hi there,
>
[quoted text clipped - 20 lines]
> thanks for reading thus far. i hope i explained the problem properly.
> my english is not the best. any help is greatly appreciated.
Matthias S. - 19 Mar 2008 14:39 GMT
thanks for your reply. so I'll got to roll my own ;)

Signature
> ".dll" assemblies do not normally read a configuration file. You
> should put your settings in a config file named
[quoted text clipped - 30 lines]
> > properly. my english is not the best. any help is greatly
> > appreciated.
TAB - 19 Mar 2008 16:47 GMT
I am using Properties.Settings.Default.xxxx for my settings in a class
library without problems.
They are saved in its own app.config as usual, different directory than the
application though.
> thanks for your reply. so I'll got to roll my own ;)
>
[quoted text clipped - 32 lines]
>> > properly. my english is not the best. any help is greatly
>> > appreciated.