如何从MsBuild找到tf.exe的路径
我有一个 MsBuild 文件,它使用 tf.exe 向 TFS 输出一些内容。不幸的是,tf.exe 文件已安装到开发人员 PC 和构建服务器上的不同位置。
我真的可以用一种方法来检测 tf.exe 文件在我的脚本中的位置,就像您可以执行 $(MSBuildExtensionsPath32) 等一样。这可能吗?
一如既往的感谢:)
I have an MsBuild file which shells out to TFS using tf.exe for a few things. Unfortunately the tf.exe file has been installed to different locations on the developer PCs and the build server.
I could really do with a way of detecting where the tf.exe file is located within my script in the same way you can do $(MSBuildExtensionsPath32) etc. Is this possible?
Thanks as always :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(2)
环境变量 VS100COMNTOOLS 是否指向 Visual Studio 的正确路径?
例如
VS100COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\
所以你所需要的只是 $(VS100COMNTOOLS)..\IDE
或者你想要清理它的任何东西。
环境变量会根据 Visual Studio 的版本而变化:
%VS110COMNTOOLS%
- Visual Studio 2012%VS120COMNTOOLS%
- Visual Studio 2013%VS140COMNTOOLS%
- 视觉工作室 2015Does the environment variable VS100COMNTOOLS point to the correct path for visual studio?
E.g.
VS100COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\
So then all you need is $(VS100COMNTOOLS)..\IDE
or however you want to tidy it up.
The environment variable changes depending on the version of Visual Studio:
%VS110COMNTOOLS%
- Visual Studio 2012%VS120COMNTOOLS%
- Visual Studio 2013%VS140COMNTOOLS%
- Visual Studio 2015似乎他们在 Visual Studio 2017 中再次更改了位置。
它不在我机器上的上述任何位置。
我在以下位置找到了 TF.exe:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
(有些用户可能会在
Professional
文件夹而不是Enterprise
文件夹:C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe
)显然 VS 2017 中不再默认设置环境变量。
Seems they changed location again in Visual Studio 2017.
It was not in any of the above locations on my machine.
I found TF.exe instead at:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
(Some users may find in the
Professional
folder instead ofEnterprise
folder:C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe
)Apparently the environment variable is no longer set by default in VS 2017.