Configuration / Settings File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to use a Settings / Configuration file in VS 2005 / .Net 2.0
in a dll? Or is this feature limited to an executable?

We have some .dlls where a configuration file would be helpful for things
such as Database Connection and other aspects. But when we use this file and
try to access it using Properties.Settings.Default....., we get an object
error.

If this is possible: what are we doing wrong?
 
Hi,



Andy said:
Is it possible to use a Settings / Configuration file in VS 2005 / .Net
2.0
in a dll? Or is this feature limited to an executable?

A config is intended to be used with an application, an exe in other words,
there is no a config file for a DLL
We have some .dlls where a configuration file would be helpful for things
such as Database Connection and other aspects. But when we use this file
and
try to access it using Properties.Settings.Default....., we get an object
error.

You can either implement your own configuration utility (which is very
easy ) or include the values in the app configuration file
 
Would using the Machine.Config file work for universal things such as a
database connection?
 
You can also design an constructor which takes a configuration file.
When the object is initialized with this constructor, you can set up
all the properties.

HTH
 
John:

Thank you for this information. But of course I have some questions if you
would be so kind.

Would I simply add a normal "settings / configuration" file to the .dll like
I would to an .exe? But how would I make the constructor take this
configuration file? Would you happen to have a link that would demonstrate
this, as I understand the concept, but not sure how to implement it as this
sounds like a very definiate solution to our problem.
 
Back
Top