1

I have a big application that has lots of app.config and web.config files. I also have 4 environments so for each environment i need to change specific config values to match the working env.

I feel it is a waste of time doing it manually each time and leaves a lot of room for mistakes when changing values.

Do you know a way to make it easier working with all those config files? I also need a way to deploy them to other servers (each config to its own server and folder).

Thanks, Chen.

FelProNet
  • 689
  • 2
  • 10
  • 25
  • 1
    Have a look at [Web.config transform](http://msdn.microsoft.com/en-us/library/dd465318(v=vs.100).aspx) and [this SO for App.config transform](http://stackoverflow.com/questions/3004210/app-config-transformation-for-projects-which-are-not-web-projects-in-visual-stud). The later can be applied to any config files if you have them partitioned. – Simon Belanger Jul 09 '13 at 15:05
  • Thanks a lot! the second link is awsome! – FelProNet Jul 10 '13 at 07:50

1 Answers1

0

The steroid approach is the :

http://social.msdn.microsoft.com/Forums/vstudio/en-US/1bec3733-0d42-4d06-af61-5225bddbdb54/how-to-implement-configuration-service-50-of-the-stocktrader-50-sample-application

Configuration Service the StockTrader Application.

EDIT.............

The poor man's way is to zip up your config files SEPARATE from your binaries. And zip up the config files in their own zip file. That way, you "have them" if you need them, but you don't accidentally overwrite them on fresh deploys.

And if you add values to the config files, put them in your release notes.

Also, throwing good ArgumentNullExceptions (or similar) in your app when something from the configuration file(s) is not there........is a best practice.

granadaCoder
  • 26,328
  • 10
  • 113
  • 146