473,480 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1632
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2731
by: serge calderara | last post by:
dear all, I have problem accessing section group in my configuration application file. I got an error saying thta I can have only one section ???? here is my application configuration looks...
3
2868
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with...
7
5969
by: MrNobody | last post by:
I was a Java developer so I'm used to using property files as a means to keep configuration settings for my apps. I'm wondering what options are there with ..NET? Some settings I want to include...
7
22465
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
5
4569
by: Water Cooler v2 | last post by:
I know that we can add a single name value entry in app.config or web.config in the configuration/configSettings/appSettings section like so: <add key="key" value="value" /> Question: I want...
5
2919
by: Hardy Wang | last post by:
Hi all, I understand, in .Net 2.0 we have little bit different model to read config file from .Net 1.1. Basically I need to use WebConfigurationManager.AppSettings to read from web.config, and...
5
1858
by: Allan Ebdrup | last post by:
I have a webservice in ASP.Net 2.0, I need to store and load a xml configuration file in relation to one of the web methods in my webservice. What's the best place to store and the best way to load...
4
56986
by: aSoundMind | last post by:
Hi there, I recieve this error Server Error in '/integrate' Application. -------------------------------------------------------------------------------- Configuration Error Description: An...
2
3600
by: Jan Eliasen | last post by:
Hi I am having some problems reading configuration values from a configuration file, using C# 2.0. I have programmed a Windows Service, and this part goes well - it runs nicely. Now, the...
2
2756
by: remya1000 | last post by:
i'm using VB.NET 2003. Last time while i did a program in Vb.Net 2005, i use "Configuration". and i could read and write to that XML configuration file like the example below. CODES:...
0
7041
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6739
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4779
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.