Gas said:
I am developing a Class library and I want to use config file to
store some of the key-value pairs..
Heard that app.config is not supported by Class library, is it? if
so, what should I do if I need a config file?
Config files are associated with the process, not a library:
http://www.grimes.demon.co.uk/dotnet/configFAQ.htm
If your settings are only used by your classes then you can use a separate
configuration file. The easiest way to do this is to create a serializable
class with the key-value pairs as fields, and then use the XmlSerializer
attributes on that class to define the XML for the data. Just before you
first need to read the key-value pairs deserialize the configuration object
from the XML configuration file using XmlSerializer, and when the values on
the configuration object changes use a XmlSerializer to serialize the
configuration object to the XML disk file.
Richard