Continue TFS Build After Project\Solution Compilation failure

8 באפריל 2010

אין תגובות

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.

Branch

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.  

Delete Rethrow Exception

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.

Cut WorkItem From Per Project Exception Hundle

 

This should work with no problem. Enjoy!

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. (*) שדות חובה מסומנים