Suppose a large composite application built on several foundation components packaged in their own assemblies: (database reading, protocol handlers, etc.). For some deploy
Set up build configurations for each of your deployment/testing environment and use separate config files based on each build configuration.
ScottGu has a nice post about this and it works great. The only quirk we have is that we need to make sure that the config files (web.config) are checked out for edit from TFS before each build so that it can be copied over.