我正在使用MSBuildCommunityTasks在构建时检索git提交哈希:
<GitVersion LocalPath="$(MSBuildProjectDirectory)">
<Output TaskParameter="CommitHash" PropertyName="GitRevision" />
</GitVersion>MSBUILD按预期在本地机器上执行此任务,但在的宿主执行时失败:
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.显然,根据安装的软件包列表: TFService使用的宿主构建控制器不允许直接访问git.exe:http://listofsoftwareontfshostedbuildserver.azurewebsites.net/
如何检索托管构建控制器上的git提交信息?
发布于 2015-11-03 15:15:05
这确实帮了忙。基本上,我不得不用这个选项重新安装Git
从命令提示符中使用Git

发布于 2015-12-16 16:17:18
这是因为MSBuild找不到git.exe的位置(即。C:\Program \Git\bin)您可以检查您的java.library.path (Manage > System )是否包含git路径,如果不需要,则需要将git位置添加到path变量中,然后重新启动服务器才能生效。希望能帮上忙。
**在Windows环境中,java.library.path与PATH变量相同。
https://stackoverflow.com/questions/19916115
复制相似问题