We are working on fine tuning the automated build process using TFS 2010. During development, we use a special configuration to run our unit tests. During the build, does it make sense/possible to do the following: Compile the application in UnitTest configuration and run unit tests. If all pass, run the build in release configuration and deploy.
The reasoning behind the above suggestion is that we are using config file transformation for some settings. However, I can make the build server match those, without the need for a different set up. I also wonder if the above approach is supported in TFS build. I.E: How do you run two compilations in different configurations.
Or is the following approach better: Compile the application in Release configuration and run unit tests. If all pass, deploy.
If you edit your build definition in Team Explorer and navigate to the Process page, you'll see an "Items to Build" parameter in the Required section. If you expand that parameter, you'll see a child parameter called "Configurations to Build." Clicking the ellipsis button for that property invokes a dialog where you can specify the platforms and configuration you want to build. By default, TFS will build the default platform and configuration only. You can, however, specify as many configurations as you like.
Regarding which configuration to test and deploy, I would personally lean towards the release version since. Make sure you're still generating symbols for that configuration and you should still get full stack trace information for any test failures. If you intend to deploy the release build, then that's probabaly the configuration you should be running your tests on.