473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Registry vs Config files

I know this topic has been discussed before but I couldn't find any
thread more recent than about 18 months and was interested in what
conclusions people had come to recently.

Invariably 3 advantages of XML config files are promoted;

1. The .NET framework provides built-in support for reading
application configuration data from .config files very easily

2. Using these files makes it possible to deploy an application using
XCOPY and remove it using DEL directory

3. Storing application data in config files may allow it to be
executed on a non-Microsoft .NET platform

However it seems to me that there are strong arguments that invalidate
much of these advantages.

Firstly, the .NET framework support for .config files provides
read-only support but no support for writing data. This makes it more
difficult to save runtime application data (such as form position or
MRU file list). While the .config file could be treated as a standard
XML file and written to, they can be quite complex and most people
seem to agree that you might as well save your data to a custom XML
file instead.

This raises the issue of where to store this new custom XML file. If
it is not stored in the application directory then it is likely to be
overlooked in any subsequent deployment or application removal.
Storing it in the application directory requires the user to have
write access to the application directory. This is often undesireable
and counter to efforts by Microsoft to remove write access to the
Program Files directory tree from 'ordinary' users.

Furthermore, often runtime application data like this is expected to
be saved on a user-by-user basis. This either results in a single
large 'multi-user' save file in the application directory, or many
individual user save files in the application directory (both
requiring the user to have write access) or saving the data in a file
in the user's My Documents area (back to the file getting left
behind).

Many people seem to keep coming back to being able to deploy an
application using XCOPY but I fail to see why this is so important.
Most applications are deployed using an installation scripting tool
and will this will continue as far as I can tell. Beyond copying the
application's files, there are many other tasks that may need to be
completed to fully install a typical application;

a. Associating file types with the application
b. Registering any legacy COM objects (at least for a while yet)
c. Ensuring that any required assemblies are installed
d. Setting up .NET security (such as Code Access Security)
e. Installing a service perhaps

All this suggests to me that the only truly legitimate benefit is the
'possible' ability to run the application on a non-MS platform.

But on the flip side, the Registry seems to continue to offer
significant benefits;

a. Automatically looks after user-by-user data stroed in HKCU and
,when coupled with roaming profiles, ensures that user data is
available wherever the user logs on to the network
b. Provides a single centralised repository for this information
allowing Administrators to reasonably easily locate such data without
having to search the hard drive
c. Coupled with network policies, standard user registry settings can
be setup automatically
d. Provides a ready-built management application (regedit) for
maintaining this information
e. Administrator may be able to access the registry remotely to make
adjustments
f. Registry keys are securable objects allowing the Administrator to
establish who can have access to make changes
g. The registry has a semi-secure area for the storage of sensitive
information

I am about to start porting an existing application framework to .NET
and it currently makes extensive use of the registry. I am interested
in what other developers are doing and what you think about my logic
outlined above.

Beyond platform portability which is not high on my list at this time,
why shouldn't I continue to use the registry?
Nov 22 '05 #1
2 2737
Hi Tim,

There is nowhere written that you should use one approach you can use by
instance the registry for
the last form settings
last path when it is Access

You can use by instance an XML file for language dependable texts which are
not standard in the framework or the OS (advantage, later when needed
someone who speaks a language you do not know can add that language to your
program)

Just some thoughts,

Cor
Nov 22 '05 #2
Tim Blizard wrote:
Firstly, the .NET framework support for .config files provides
read-only support but no support for writing data. This makes it more
difficult to save runtime application data (such as form position or
MRU file list). While the .config file could be treated as a standard
XML file and written to, they can be quite complex and most people
seem to agree that you might as well save your data to a custom XML
file instead.

This raises the issue of where to store this new custom XML file. If
it is not stored in the application directory then it is likely to be
overlooked in any subsequent deployment or application removal.
So, all you have to do is to (1) check for it's existance on the start of
your application and (2) write a fresh copy if it's not there.

PS -- This same problem would apply to the config file, or an INI file, or
with the Registry for that matter if you moved the app to a new computer or
had a new user log in and try to use it ( assuming that the entries are not
system wide ).
and counter to efforts by Microsoft to remove write access to the
Program Files directory tree from 'ordinary' users.
There are plenty of sanctioned places to put it then. How about the
Temporary Files folder inside of Local Settings ?
application's files, there are many other tasks that may need to be
completed to fully install a typical application;
And that is why .NET and Visual Studio provide for creating a setup
application as part of a solution.

But on the flip side, the Registry seems to continue to offer
significant benefits;


The Registry is the "dll hell" of configuration. XML is the obvious way to
go.
Nov 22 '05 #3

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

Similar topics

3
by: Rohit Santhanam | last post by:
As I am reading the .NET documentation, I get the feeling that Microsoft is trying to get rid of the registry. My understanding is that an application built using .NET does not use the registry...
2
by: Bob Olsson | last post by:
Hello all! I´m going to develop a windows smartclient and can´t find the information I need. Where do I store user-settings like paths, background colour and so on. I´ve read an article about...
8
by: Bob Kirkwood | last post by:
I believe the intent in .NET is that we store application setup information in an XML file now instead of the Registry or INI files. Is this correct? Are there any tools, sample apps, or...
1
by: Martin Harran | last post by:
I understand that MS are encouraging developers using the NET platform to move away from storing application related data in the registry and to store it in data files instead. Is there a "best...
2
by: Tim Blizard | last post by:
I know this topic has been discussed before but I couldn't find any thread more recent than about 18 months and was interested in what conclusions people had come to recently. Invariably 3...
10
by: Clint | last post by:
Hey all - I'm having a really confusing problem concerning a web service. Right now, I have an application that needs to call a web service that does nothing but return "true" (this will...
2
by: Daniel Bass | last post by:
I've found this article on how to get ASP.Net to read/write from the server's registry, but it got heavily critted as being something that you should not do... ...
17
by: Sam | last post by:
Hi all If I only want to store screen location and size of my application in Windows Registry, which of the keys should I store this info? A sample code is greatly appreciated. Thank you ...
2
by: newscorrespondent | last post by:
Is there an MSDN article that I can't find on replacing the registry calls (Registrykey.GetValue, Registrykey.SetValue) with the calls to get and put the same data in app.config? Thanks Tom
6
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.