473,770 Members | 7,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2905
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____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:4A******** *************** ***********@mic rosoft.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
2882
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 applications and web services without having to use the machine.config file. I know that I could use the code below to do this but the problem then becomes that when using a shared assembly both the assembly and the config file need to be put...
1
1360
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 recompile the projects my "AppPrimary.exe" no longer works correctly. I've noticed that when AppPrimary.exe runs with the Non-Strong-Named version of the Config Block the following has the proper values (i.e. Current.builder=...
5
1250
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 the form of ini files. I am trying to learn new techniques (OOP etc..) and trying to make my app as modern as possible. Are XML files the preferred method of doing this? Whatever the correct way of handling configuration files is, can someone...
1
1394
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 component's name is MyComponent.dll, my config file is named MyComponent.config. Here is the file contents: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings>
4
1307
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 reload if required), is this possible in the new ASP.Net 2.0 ? thanks
6
1450
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 file. How can i choose in the .bat file which configuration file to use ? (something like myApp.exe -D file1.config). Thanks.
0
2585
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
10323
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 called AssemblySettings that someone (I forget his name) had written. When the class library was finished, you deployed it to the GAC and put the configuration files in the GAC with the class library assembly. This no longer works. In fact...
1
3825
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 configuration files in the <root-dir> of the application. I am specifying the path for WebAgent.conf as “/WebAgent.conf” in my AuthenticateUser java class and in WebAgent.conf, the reference to SmHost.conf is given as “/SmHost.conf”. I am copying...
0
9592
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10058
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7416
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
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
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.