问题描述
可以在以下位置找到MSBuild的早期版本:%programfiles(x86)%\msbuild\<version>\bin\msbuild.exe.
Earlier versions of MSBuild could be found here: %programfiles(x86)%\msbuild\<version>\bin\msbuild.exe.
但是对于Visual Studio 2017RC,路径为%programfiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe
.安装类型:企业,社区或专业,似乎是其中的一部分.这就使得在BAT文件中指定msbuild的正确路径变得困难,该文件应在具有不同版本Visual Studio 2017的许多不同计算机上运行.
But for Visual Studio 2017RC the path is %programfiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.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?
推荐答案
Microsoft创建了一个工具来查找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版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!