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
Just a little improvement to the solution that seems to be posted everywhere now: