If you really want to fully automate this, you can do something like this:
First save the settings for different environments in the original control, but not in the configuration file. For instance:
configfiles\app.config.mikeb_home configfiles\app.config.local configfiles\app.config.development configfiles\app.config.staging configfiles\app.config.production
Then, in your build configuration, you can add a step to copy the desired configuration file to the root app.config file. For instance. with a "pre-build event" (script command line) based on the "environment" parameters (computer_name, username, ...). You can probably achieve the same by adding a few msbuild commands to the .csproj file.
However, is all this really worth it? TortoiseSVN has a function called the ignore-on-commit list that helps prevent a locally modified file from being accidentally executed that should not be committed (in the commit dialog box, right-click the file => Move to change list → ignore-on- commit). It can be a little annoying if you really need to change something in the .config file, but still.
source share