473,573 Members | 3,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strategy question regarding storing of configuration data

After reading some articles regarding confuguration data I'm a bit confused.

Where is the right place for storing configuration data?
- XML-files?
- registry?
- INI-files? (from a users point of view, ini-files are more comfortable to
read and edit)

Where should I store user specific config data?
Where should I store machine specific config data?

Why not use the registry? There are some articles, that mention, that the
registry should not be used any more. Why not? How can I implement Group
Policy without using the regisry?
The standard mechanism of C# / Net-Framework creates a file named
»Application.e xe.config« in the program directory.
Is the program directory the right place for configuration information?
Due to windows design guidelines files in the program directory should not
be edited. From this point of view, the program directory seems not to be a
good place for config information.

It would be helpfull to get some comments to this questions.
Thanks in advance

Regards ...

Oct 4 '06 #1
9 2263
Personally, I use .config files. It's easy to encrypt down to the section
level, you can extend them by creating your own config sections and the
framework provides all the classes you'll need to cleanly access and update
them.

HTH

Glenn

"KarlM" <Ma******@newsg roup.nospamwrot e in message
news:02******** *************** ***********@mic rosoft.com...
After reading some articles regarding confuguration data I'm a bit
confused.

Where is the right place for storing configuration data?
- XML-files?
- registry?
- INI-files? (from a users point of view, ini-files are more comfortable
to
read and edit)

Where should I store user specific config data?
Where should I store machine specific config data?

Why not use the registry? There are some articles, that mention, that the
registry should not be used any more. Why not? How can I implement Group
Policy without using the regisry?
The standard mechanism of C# / Net-Framework creates a file named
»Application.ex e.config« in the program directory.
Is the program directory the right place for configuration information?
Due to windows design guidelines files in the program directory should not
be edited. From this point of view, the program directory seems not to be
a
good place for config information.

It would be helpfull to get some comments to this questions.
Thanks in advance

Regards ...

Oct 4 '06 #2
Unfortunately, there's no really good answer, just the one that, in
your particular circumstance, is better than the rest.

Some things to consider when trying to decide whcih that is:
- If XML or the registry scare your users, they probably shouldn't be
editting a configuration file manually anyway.
- In a properly locked-down system, the C:\Program Files tree should be
writable only to administrators. Hence, the application.exe .config
should probably only be used for items that are set at installation and
never changed.
-Small amounts of user-specific data should probably go in the
HKEY_Current_Us er section of the register.
- Large amounts of user-specific data should probably go the isolated
storage (C:\Documents and Settings\user\L ocal Settings\Applic ation
Data)
-Small amounts of machine -specific data should probably go in the
HKEY_LOCAL_MACH INE section of the register.
-I have no idea where large amounts of machine-specific data should go.
KarlM wrote:
After reading some articles regarding confuguration data I'm a bit confused.

Where is the right place for storing configuration data?
- XML-files?
- registry?
- INI-files? (from a users point of view, ini-files are more comfortable to
read and edit)

Where should I store user specific config data?
Where should I store machine specific config data?

Why not use the registry? There are some articles, that mention, that the
registry should not be used any more. Why not? How can I implement Group
Policy without using the regisry?
Oct 4 '06 #3
Hi Martin,

Actually, you can use any other these 3 ways to store the configuration
data. But for a .NET app, we suggest you use the app.config file.

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Oct 5 '06 #4
Thanks to anybody for comments!

OK, it seems to be »state of the art« to use XML-Files for configuration data.
But there are really a few questions left:

1.
There are many needs to change application specific data after installation.
For sure, only the system administrator should do this.
Should the config-file better be saved in »common application data« instead
of the ProgDir-Folder?
Is there a way to do this using the net standard features (I could not find
a solution to change the folder (or name) of the application.exe .config).

2.
As far as I know, the application.exe .config cannot be changed during runtime.
So, it seems to me, that I have to implement a second Configuration file,
that can be changed by the administrator at runtime of the app. Correct?

So, it seems to me, that the application.exe .config is basicly a config-file
for the developer, but not for the administrator of the system.

I found a statement at:
http://www.builderau.com.au/program/...9211304,00.htm

This solution seems to be more flexible.

I am looking forward to further comments, just to make sure, that I
understood the basic concept of the net-config-mechanism.

Thanks.

Regards
Karl.



After reade



"KarlM" wrote:
After reading some articles regarding confuguration data I'm a bit confused.

Where is the right place for storing configuration data?
- XML-files?
- registry?
- INI-files? (from a users point of view, ini-files are more comfortable to
read and edit)

Where should I store user specific config data?
Where should I store machine specific config data?

Why not use the registry? There are some articles, that mention, that the
registry should not be used any more. Why not? How can I implement Group
Policy without using the regisry?
The standard mechanism of C# / Net-Framework creates a file named
»Application.e xe.config« in the program directory.
Is the program directory the right place for configuration information?
Due to windows design guidelines files in the program directory should not
be edited. From this point of view, the program directory seems not to be a
good place for config information.

It would be helpfull to get some comments to this questions.
Thanks in advance

Regards ...
Oct 5 '06 #5
"KarlM" <Ma******@newsg roup.nospamwrot e in message
news:F5******** *************** ***********@mic rosoft.com...
Thanks to anybody for comments!

OK, it seems to be »state of the art« to use XML-Files for configuration
data.
But there are really a few questions left:

1.
There are many needs to change application specific data after
installation.
For sure, only the system administrator should do this.
Should the config-file better be saved in »common application data«
instead
of the ProgDir-Folder?
Is there a way to do this using the net standard features (I could not
find
a solution to change the folder (or name) of the application.exe .config).
You can encrypt sections of the file to prevent user tampering.
2.
As far as I know, the application.exe .config cannot be changed during
runtime.
So, it seems to me, that I have to implement a second Configuration file,
that can be changed by the administrator at runtime of the app. Correct?
It definately can be changed at runtime.
So, it seems to me, that the application.exe .config is basicly a
config-file
for the developer, but not for the administrator of the system.
Can't agree with you there. I personally believe it makes a developers
lives easier, but our guys in the Support team like them as well given the
farting around that have to do with some non-.NET apps we have around.

What about web applications? Web.config makes administration pretty easy.
I found a statement at:
http://www.builderau.com.au/program/...9211304,00.htm

This solution seems to be more flexible.
If you want to, sure, but you can extend config files by creating your own
configuration section classes which are type-safe and can be secured with
relative ease. You also don't have to mess around with type serialisation,
ok, yes, it's relatively easy, but why bother when it's all there in
System.Configur ation.

It just feels like your re-inventing the wheel.
>
I am looking forward to further comments, just to make sure, that I
understood the basic concept of the net-config-mechanism.

Thanks.

Regards
Karl.



After reade



"KarlM" wrote:
>After reading some articles regarding confuguration data I'm a bit
confused.

Where is the right place for storing configuration data?
- XML-files?
- registry?
- INI-files? (from a users point of view, ini-files are more comfortable
to
read and edit)

Where should I store user specific config data?
Where should I store machine specific config data?

Why not use the registry? There are some articles, that mention, that the
registry should not be used any more. Why not? How can I implement Group
Policy without using the regisry?
The standard mechanism of C# / Net-Framework creates a file named
»Application.e xe.config« in the program directory.
Is the program directory the right place for configuration information?
Due to windows design guidelines files in the program directory should
not
be edited. From this point of view, the program directory seems not to be
a
good place for config information.

It would be helpfull to get some comments to this questions.
Thanks in advance

Regards ...

Oct 5 '06 #6
Hi Glenn,

thanks for your comments. I think you are right.

So I am going to look a bit deeper into the System.configur ation classes and
try to use them.
If you have some documentation / links / sample available about the using of
these classes, that would be great.

Thanks for your help.
Regards
Karl.

"Glenn" wrote:
"KarlM" <Ma******@newsg roup.nospamwrot e in message
news:F5******** *************** ***********@mic rosoft.com...
Thanks to anybody for comments!

OK, it seems to be »state of the art« to use XML-Files for configuration
data.
But there are really a few questions left:

1.
There are many needs to change application specific data after
installation.
For sure, only the system administrator should do this.
Should the config-file better be saved in »common application data«
instead
of the ProgDir-Folder?
Is there a way to do this using the net standard features (I could not
find
a solution to change the folder (or name) of the application.exe .config).

You can encrypt sections of the file to prevent user tampering.
2.
As far as I know, the application.exe .config cannot be changed during
runtime.
So, it seems to me, that I have to implement a second Configuration file,
that can be changed by the administrator at runtime of the app. Correct?

It definately can be changed at runtime.
So, it seems to me, that the application.exe .config is basicly a
config-file
for the developer, but not for the administrator of the system.

Can't agree with you there. I personally believe it makes a developers
lives easier, but our guys in the Support team like them as well given the
farting around that have to do with some non-.NET apps we have around.

What about web applications? Web.config makes administration pretty easy.
I found a statement at:
http://www.builderau.com.au/program/...9211304,00.htm

This solution seems to be more flexible.

If you want to, sure, but you can extend config files by creating your own
configuration section classes which are type-safe and can be secured with
relative ease. You also don't have to mess around with type serialisation,
ok, yes, it's relatively easy, but why bother when it's all there in
System.Configur ation.

It just feels like your re-inventing the wheel.

I am looking forward to further comments, just to make sure, that I
understood the basic concept of the net-config-mechanism.

Thanks.

Regards
Karl.



After reade



"KarlM" wrote:
After reading some articles regarding confuguration data I'm a bit
confused.

Where is the right place for storing configuration data?
- XML-files?
- registry?
- INI-files? (from a users point of view, ini-files are more comfortable
to
read and edit)

Where should I store user specific config data?
Where should I store machine specific config data?

Why not use the registry? There are some articles, that mention, that the
registry should not be used any more. Why not? How can I implement Group
Policy without using the regisry?
The standard mechanism of C# / Net-Framework creates a file named
»Application.e xe.config« in the program directory.
Is the program directory the right place for configuration information?
Due to windows design guidelines files in the program directory should
not
be edited. From this point of view, the program directory seems not to be
a
good place for config information.

It would be helpfull to get some comments to this questions.
Thanks in advance

Regards ...


Oct 6 '06 #7
Hi Karl,

If you need some configurations to be changed, you can take a look at the
Setting files. Here is a technical article.

http://msdn.microsoft.com/library/de...us/dnvs05/html
/SettingsCS_RL.a sp

I think it will meet your requirements. Let me know if you have any concern
on it.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Oct 6 '06 #8
Karl

Here's where I started in .net 2.

http://msdn2.microsoft.com/en-us/lib...onmanager.aspx

From here you'll find all the documentation and examples you'll need. There
would seem to a lot to it, which there is, but actually its pretty simple to
use.

HTH

Glenn

"KarlM" <Ma******@newsg roup.nospamwrot e in message
news:ED******** *************** ***********@mic rosoft.com...
Hi Glenn,

thanks for your comments. I think you are right.

So I am going to look a bit deeper into the System.configur ation classes
and
try to use them.
If you have some documentation / links / sample available about the using
of
these classes, that would be great.

Thanks for your help.
Regards
Karl.

"Glenn" wrote:
>"KarlM" <Ma******@newsg roup.nospamwrot e in message
news:F5******* *************** ************@mi crosoft.com...
Thanks to anybody for comments!

OK, it seems to be »state of the art« to use XML-Files for
configuration
data.
But there are really a few questions left:

1.
There are many needs to change application specific data after
installation.
For sure, only the system administrator should do this.
Should the config-file better be saved in »common application data«
instead
of the ProgDir-Folder?
Is there a way to do this using the net standard features (I could not
find
a solution to change the folder (or name) of the
application.exe .config).

You can encrypt sections of the file to prevent user tampering.
2.
As far as I know, the application.exe .config cannot be changed during
runtime.
So, it seems to me, that I have to implement a second Configuration
file,
that can be changed by the administrator at runtime of the app.
Correct?

It definately can be changed at runtime.
So, it seems to me, that the application.exe .config is basicly a
config-file
for the developer, but not for the administrator of the system.

Can't agree with you there. I personally believe it makes a developers
lives easier, but our guys in the Support team like them as well given
the
farting around that have to do with some non-.NET apps we have around.

What about web applications? Web.config makes administration pretty
easy.
I found a statement at:
http://www.builderau.com.au/program/...9211304,00.htm

This solution seems to be more flexible.

If you want to, sure, but you can extend config files by creating your
own
configuratio n section classes which are type-safe and can be secured with
relative ease. You also don't have to mess around with type
serialisatio n,
ok, yes, it's relatively easy, but why bother when it's all there in
System.Configu ration.

It just feels like your re-inventing the wheel.
>
I am looking forward to further comments, just to make sure, that I
understood the basic concept of the net-config-mechanism.

Thanks.

Regards
Karl.



After reade



"KarlM" wrote:

After reading some articles regarding confuguration data I'm a bit
confused.

Where is the right place for storing configuration data?
- XML-files?
- registry?
- INI-files? (from a users point of view, ini-files are more
comfortable
to
read and edit)

Where should I store user specific config data?
Where should I store machine specific config data?

Why not use the registry? There are some articles, that mention, that
the
registry should not be used any more. Why not? How can I implement
Group
Policy without using the regisry?
The standard mechanism of C# / Net-Framework creates a file named
»Application.e xe.config« in the program directory.
Is the program directory the right place for configuration
information?
Due to windows design guidelines files in the program directory should
not
be edited. From this point of view, the program directory seems not to
be
a
good place for config information.

It would be helpfull to get some comments to this questions.
Thanks in advance

Regards ...



Oct 6 '06 #9
Glenn is right. MSDN document has given us very good sample of how to use
ConfigurationMa nager class. You can also find some more samples on other
sites. Here are some of them.

http://codebetter.com/blogs/john.pap...07/132852.aspx
http://www.dotnet-guide.com/configur...ger-class.html

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Oct 10 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
3443
by: Chris Lasher | last post by:
Hello, I have a rather large (100+ MB) FASTA file from which I need to access records in a random order. The FASTA format is a standard format for storing molecular biological sequences. Each record contains a header line for describing the sequence that begins with a '>' (right-angle bracket) followed by lines that contain the actual...
1
3725
by: Cherrish Vaidiyan | last post by:
sir, I have a small error in Listener configuration.I have two system with a database in each. I am using Red Hat 9 and Oracle 9i. so i shall anme the database and system. system 1 - node2 system 2 - node3 database - apple database - intel i have installed Oracle on 'node3' by copying the...
1
3746
by: peter wang | last post by:
Hi, Could anyone tell me the backup strategy for a 1000GB database? Thank you! Peter Wang *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
4
1971
by: Claudio Jolowicz | last post by:
I am trying to find a solution to the following design problem (code at the bottom): We are implementing a trader agent that can trade with other traders on an electronical trading platform. To make the trader more extensible, we have defined a strategy interface and implemented this interface for different trading strategies. The problem...
3
2386
by: Bob | last post by:
All, I have read through lots of postings regarding my concerns, but I haven't found what I am looking for. The center (non profit University) where I work collects scientific data about subjects enrolled in studies related to respiratory diseases. Both lab data and questionnaire information are collected. We use W2K as PC operating...
1
9932
by: Derek | last post by:
Hi All, I am developing a Windows based application that consists of several different modules. These modules are effectively separate from each other yet share information in a common database. I would like to be able deliver specific modules depending on what the needs of the client are. Some clients may only need Module A and B, while...
2
1398
by: hendry.johan | last post by:
Hi, I'm currently developing an HR system which involves storing a lot of configurations per module, such as payroll module, absence/shift module, training module, etc. total: around 100 configuration items. Configurations here, ranging from a simple key to value pair, a key to multiple values, and a key to several records of a / multiple...
1
1332
by: Terrance | last post by:
I was wondering if someone can help me with my question regarding the configuration system functionality in the .NET Framework 2.0 for VB. My question is, if I have a application configuration file; can the values in the file be changed? I read that the Application settings are read-only; is there any way of changing the data programmatically?...
9
2105
by: Harold Crump | last post by:
Greetings, I have a fairly vanilla PHP web application that stores and retrieves data in a MySQL database. Users will be adding a lot of special characters such as single and double quotes, accented French characters, etc. I want to eliminate any potential for XSS or SQL injection attacks. My question - is it enough to pass all user...
0
7789
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8037
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8086
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6432
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5296
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3737
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3743
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2227
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 we have to send another system

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.