473,385 Members | 1,486 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,385 software developers and data experts.

Versioning of Xml configuration files (C# project)

Hey everyone,

I'm currently writing software for a project that uses a lot of Xml files
for configuration. The project is written in C#/.NET. Each such xml file has
a schema defined for it (Xsd file). This schema is not used at run-time. What
we do is use XPath expressions to query for required information (nodes).

We are currently still in development, but we have a few deployments to test
the software. These deployments each have their own configuration (eg for
coordinates).

The problem comes when an upgrade of the software is distributed. Upgrading
the binaries (software) is trivial: just copy. However upgrading the
configuration (xml-)files automatically is another story. The information
that is in the configuration files should stay the same. New information
should be inserted in the configuration files, preferably automatically.
Information that is no longer needed should be retained (this to facilitate a
downgrade of the software, for which I do not intend to write software).
Information elements that did not exist in an earlier version, is queried for
at the time of upgrade or has a default, and should then be inserted.

I would like to know what other people (would) do in this situation. Are
there any tools to facilitate this sort of upgrades? Any .NET libraries that
could help?

With kind regards,
PS: Sorry if this post is a little off-topic.
--
Tom Tempelaere.

Nov 16 '05 #1
1 2892
Most installers will allow you to run a process during the install. You
could always write an object that represents your xml, and desterilize the
XML, and in the "set" for each property check for null, if it's null set to
a default value, then serialize the object back to XML. This would require
that your object keep any properties that you are going to want to keep in
your xml doc for the downgrade possibility.

Then you would have your install run an app that you write to load the file,
desterilize the data to an object, serialize the data, and save the file.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:4A**********************************@microsof t.com...
Hey everyone,

I'm currently writing software for a project that uses a lot of Xml files
for configuration. The project is written in C#/.NET. Each such xml file has a schema defined for it (Xsd file). This schema is not used at run-time. What we do is use XPath expressions to query for required information (nodes).

We are currently still in development, but we have a few deployments to test the software. These deployments each have their own configuration (eg for
coordinates).

The problem comes when an upgrade of the software is distributed. Upgrading the binaries (software) is trivial: just copy. However upgrading the
configuration (xml-)files automatically is another story. The information
that is in the configuration files should stay the same. New information
should be inserted in the configuration files, preferably automatically.
Information that is no longer needed should be retained (this to facilitate a downgrade of the software, for which I do not intend to write software).
Information elements that did not exist in an earlier version, is queried for at the time of upgrade or has a default, and should then be inserted.

I would like to know what other people (would) do in this situation. Are
there any tools to facilitate this sort of upgrades? Any .NET libraries that could help?

With kind regards,
PS: Sorry if this post is a little off-topic.
--
Tom Tempelaere.

Nov 16 '05 #2

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

Similar topics

3
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...
1
by: Robert N | last post by:
I was able to compile (Debug) and reference an Configuration Block project for my primary application "AppPrimary.exe". When I add a strong name file to the Configuration Block project and...
5
by: Ivan Weiss | last post by:
Hey all, I am trying to add a configuration file to my app so that I can store configuration options and provide a form to allow the user to change them. I know that these used to always be in...
1
by: QT | last post by:
Hi. Is it possible to use configuration files with a shared add-in component? I have added one to my solution for the add-in, but I can't pick up the values from my config file. If my...
4
by: Ashish | last post by:
Iam using a couple of external (other than web.config) configuration files for my project , and i want their behavior to be like that of web.config file ( the application should track changes and...
6
by: yaron | last post by:
Hi all, I want to give a sample console application for the user with 2 configuration files. I want to give also a 2 .bat files for running the sample application, one for each configuration...
0
by: Satish Babu Dasari | last post by:
HI, I have created Webservice project in Visual Studio 2005, by default it is created the Service.asmx file with the code as public string HelloWorld() { return "Hello World"; }
7
by: Peter Bradley | last post by:
OK. A bit behind the times, I know; but we're just moving over to .NET 2.0. How on earth do you manage configuration settings in a class library in .NET 2.0? In version 1.1, we used a handy class...
1
by: ajmerasunny | last post by:
Hi All, I have a java web application in which I need to read a configuration file(WebAgent.conf) that has the reference of another configuration file(SmHost.conf). I am placing both these...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.