I am using MSBuildCommunityTasks to retrieve the git commit hash at build time:
<GitVersion LocalPath="$(MSBuildProjectDirectory)">
<Output TaskParameter="CommitHash" PropertyName="GitRevision" />
</GitVersion>
MSBUILD executes this task as expected on my local machine but fails on when Team Foundation Service's Hosted Build Controller executes it:
SalesApplication.Versioning.csproj (81): The "GitVersion" task failed unexpectedly.
System.Exception: Could not find git.exe. Looked in PATH locations and various common folders inside Program Files.
Apparently the hosted build controllers employed by TFService do not afford direct access to git.exe according to the list of installed packages: http://listofsoftwareontfshostedbuildserver.azurewebsites.net/
How can MSBUILD retrieve git commit information on the hosted build controller?