By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,670 Members | 1,431 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,670 IT Pros & Developers. It's quick & easy.

Versioning of Xml configuration files (C# project)

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.