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:
When upgrading the webapp, backup the Web.config and restore it afterwards. This is not elegant and if the latest webapp defines new default-valued properties in the Web.config then this will break
Write some admin-only configuration pages on the site and store the values in the DB. This puts the control back in our hands, but it will take work to write this and obviously has bootstrapping problems with connection strings.
Is there a better way?