471,348 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Configuration / Settings File

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?
Dec 28 '05 #1
4 1568
Hi,

"Andy" <An**@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
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
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
If this is possible: what are we doing wrong?

Dec 28 '05 #2
Would using the Machine.Config file work for universal things such as a
database connection?

"Andy" wrote:
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?

Dec 28 '05 #3
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

Andy wrote:
Would using the Machine.Config file work for universal things such as a
database connection?

"Andy" wrote:

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?

Dec 28 '05 #4
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.

"John Sun" wrote:
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

Andy wrote:
Would using the Machine.Config file work for universal things such as a
database connection?

"Andy" wrote:

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?

Dec 29 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Mike Livenspargar | last post: by
5 posts views Thread by Water Cooler v2 | last post: by
5 posts views Thread by Hardy Wang | last post: by
5 posts views Thread by Allan Ebdrup | last post: by
2 posts views Thread by Jan Eliasen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.