如何从 BAT 文件调用 Visual Studio 2017 RC 版本的 MSBuild? [英] How do I call Visual Studio 2017 RC's version of MSBuild from a BAT file?
问题描述
可以在此处找到早期版本的 MSBuild:%programfiles(x86)%msbuild<version>inmsbuild.exe.
Earlier versions of MSBuild could be found here: %programfiles(x86)%msbuild<version>inmsbuild.exe.
但对于 Visual Studio 2017RC,路径是 %programfiles(x86)%Microsoft Visual Studio2017EnterpriseMSBuild15.0Binmsbuild.exe
.安装类型:企业、社区或专业,似乎是路径的一部分.这使得在 BAT 文件中指定 msbuild 的正确路径变得困难,该文件应该可以在具有不同版本 Visual Studio 2017 的许多不同计算机上运行.
But for Visual Studio 2017RC the path is %programfiles(x86)%Microsoft Visual Studio2017EnterpriseMSBuild15.0Binmsbuild.exe
. The type of install: enteprise, community or professional, seems to be part of the path. And that makes it difficult to specify the correct path to msbuild in a BAT file that should work on many different computers with different versions of Visual Studio 2017.
从 bat 文件调用 Visual Studio 2017 RC 版本的 Msbuild 的最佳方法是什么?还是来自 PowerShell?
What is the best way to call Visual Studio 2017 RC's version of Msbuild from a bat file? Or from PowerShell?
推荐答案
微软创建了一个工具来查找 Visual Studio 2017 和更新版本的位置 https://github.com/Microsoft/vswhere
Microsoft have created a tool to find the location of Visual Studio 2017 and newer https://github.com/Microsoft/vswhere
这篇博文.
这篇关于如何从 BAT 文件调用 Visual Studio 2017 RC 版本的 MSBuild?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!