Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
My way of dealing with TFS Binaries folder... Simply call the following MSBuild task anywhere you want it to be executed :) <DisplayBinariesFolder RootFolder="C:\a\bin"/>
<UsingTask TaskName="DisplayBinariesFolder" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<RootFolder ParameterType="System.String" Required="true"/>
<Reference Include="System.Core"/>
<Using Namespace="System"/>
<Using Namespace="System.IO"/>
<Using Namespace="Microsoft.Build.Framework"/>
<Using Namespace="Microsoft.Build.Utilities"/>
<Code Type="Fragment" Language="cs">
try {
string root = Path.GetFullPath(RootFolder);
if (!Directory.Exists(root))
Log.LogMessage("Directory " + root + " does not exist!");
return false;
Log.LogMessage("Scanning directory " + root);
DirectoryInfo rootDirectory = new DirectoryInfo(root);
foreach (FileInfo file in rootDirectory.GetFiles("*.*", SearchOption.AllDirectories))
return true;
catch (Exception ex){
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment