For Visual Studio 2010 Web based application we have Config Transformation features by which we can maintain multiple configuration files for different environments. But the
proposed solution will not work when a class library with config file is referenced from another project (in my case it was Azure worker project library). It will not copy correct transformed file from obj
folder into bin\##configuration-name##
folder. To make it work with minimal changes, you need to change AfterCompile
target to BeforeCompile
: