Deleting SharePoint Builds With Out Of Drop Location Files

When using the TFS build facilities with SharePoint components when MSbuild execute calls to devenv.exe to build native deployment projects you may experience no issues, however this excludes a common situation where SharePoint deployment projects are pushed to a different team build drop location. However, when using build deletion options such as keep the 2 latest builds you may find that these enforcements don’t apply to the custom drop locations.

This leads to an issue of maintaining harmony in source control since the builds are not synchronized. While this is not ideal, using the inbuilt TFS retention policies are limited since they work against known parameters such as the build label, build global list, and build metadata. This implies that the policies are not enforceable as they lay outside the scope of the TFS retention faculties.

However, the issue is solvable if you use TFS event modeling to hook into the Build Completion event, and then have the subscription point to your own web / WCF service. It’s about the only approach that I have seen be successful.