I have learned that builds should be very straight forward and requires less human intervention. In my situation, I have 3 environments, DEV (development version), SIT (STG integration testing) and UAT (user acceptance testing). All these environments have different database connection details and other settings (such as logging). 

Currently when application needs to be deployed to SIT environment, what I need to do is to build the application. Install it on the target environment and modify the configuration file by hand. This is problematic as I may miss some entries. Things will get worse when configuration file is huge. 

**Questions**

1 - Is there anyway to specify the environment name when making a build from VS. So that the configuration file for that environment will be used. 

2 - What are the other methods which will help to reduce human intervention in builds?

3 - Assume my applications name is "Foo". I have a package project in the solution which will create installable package. Is there anyway to specify the product title depending upon the environment? I mean if SIT is selected, product name when installing will be "Foo-SIT". I guess this will avoid confusion of what environment version one is installing. I would be happy to hear any better alternatives if there are any.