mkus
mkus

Reputation: 3497

How to apply versioning strategies on config files used by .Net Framework?

Think you have a .Net application using a custom config section on its config file. As the application evolves, config sections also evolve too. You distribute your application to several customers. For example, one old application uses a config file with new config section by mistake. But the application works without crash because new config file does not cause braking changes. But you have to inform the user that the config file the application used is newer than expected. How can you apply a versioning strategy to solve this problem or anything other than versioning?

Upvotes: 1

Views: 368

Answers (1)

Tigran
Tigran

Reputation: 62265

Not very clear, why you have an old applicaiton with a new configuration. Usually, if there is some versioning mess, happens that you have a new software, just updated on client side, with it's own (local) version of configuration, so "old" one.

By the way, if you have a condition like you described, I think you can for example.

  • in code to check if configuation file contains more/or less, fields then expected by current application. In this case, means that configuration file is from different version.

  • or have a version information inside configuration file and just compare two versions against each other: version of the application running and version present in config file.

Upvotes: 1

Related Questions