When using the TFS 2010 Build, In many occasions we want the build to push through and finish running all the tests and building all the Projects\Solutions its supposed to, even if some of them don’t compile.
In the default build template any compiling error will stop the build.
This can be easily changed following a few steps:
1) Go to the default TFS build template in source control and branch a new template.
2) The TFS compiles the project in a ‘try catch’ block in a ‘foreach’ loop (per project).
If an error occurs it is being handled in the catch block where a Work Item is created and the exception is being re-thrown.
Take the newly branched template and delete the “Rethrow” activity.
In this way the build will continue to compiling the next project.
* The build will be marked as ‘failed’ and one Work Item will be created for every exception that was thrown.
If you want to have only one Work Item for the whole build in case it failed; simply cut the create work item activity from the loop and place it out side the loop.
This should work with no problem. Enjoy!