I happened to run into a feature I didn’t know of… Visual Studio 2010 (beta still… soon RC) includes a function for managing different .config-files for different environments. And support for transforming them on build/publish.
Here is a MSDN-article that introduces the concept and use it. And here is an article on the subject.
Pretty cool since up to now you’ve had to do it manually with build-tasks… Not so trivial.