If you do not like to distribute configuration information (for example, access to the database), you can easily wrap certain sections of dev / prod in if-> then.
if (production) { db = prod } else { db = dev }
I saw several methods for determining the environment, from the physical name of the machine (good for restricting unauthorized use of the code), IP address, host name, etc.
An alternative that offers little security and does not affect the build process too much will use branches. Store the web.config file in your own branch with the appropriate directory structure and merge it into the 3rd branch with the latest finished production code. So:
/trunk <-- development (or its own branch) /branches/ /branches/production-pre <-- latest stable /branches/production-config <-- web.config and related only /branches/production-post <-- final merged
Yes, he works more on deployment, but he offers security if that is the desired effect.
source share