Martin Hutchinson
Martin Hutchinson

Reputation: 348

Migrating web application settings as configured through IIS

We have a few settings in our web application that can be user configured. As IIS exposes helpers for configuring "Connection Strings" and "Application Settings" we decided to take use this method of configuration.

Unfortunately this works by editing the Web.config file deployed in the web application. This means that a simple upgrade process of copying over the files from a newer web application release resets all configuration settings to the default.

Possible options:

Is there a better way?

Upvotes: 0

Views: 196

Answers (1)

Matthew Abbott
Matthew Abbott

Reputation: 61589

When I deploy new versions of whatever web application I am work on, I never deploy the configuration file. I always make this a manual step, it ensures that no critical changes are made accidentally. You also have the option of splitting your configuration files into small configuration files, e.g., you could fragment your appSettings and connectionStrings into seperate files:

<connectionStrings configSource="_Configuration\Connections.config" />
<appSettings configSource="_Configuration\Settings.config" />

Just manage your deployment with these files in mind.

Upvotes: 1

Related Questions