DLL & Configuration File

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Is there a way to use a config file in a DLL? I have built
a C# class that I want to compile as its own dll for use
in other projects. However, it needs to be able to get
some settings from a config file. When I compile it the
config file does not show up in the bin directory.

Any help would be appreciated. Thanks!
 
Dan,

DLL files do not have config files. The config file is meant to be an
application-wide settings file. If you want to have your own configuration
file, then you will have to create the mechanism yourself to access it and
read the values from it.

Hope this helps.
 
Is there a way to use a config file in a DLL? I have built
a C# class that I want to compile as its own dll for use
in other projects. However, it needs to be able to get
some settings from a config file. When I compile it the
config file does not show up in the bin directory.

Not out of the box, no - the config files are only intended for
applications.

Which is really stupid, in a way - I might implement a DLL which has
quite a bit of functionality, and I'd really like to add a config file
to that assembly, right?

Well, there's help in the form of third-party components, such as:

http://www.codeproject.com/csharp/Custom_Config_File_Reader.asp

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Back
Top