如何从BAT文件调用Visual Studio 2017 RC的MSBuild版本? [英] How do I call Visual Studio 2017 RC's version of MSBuild from a BAT file?

查看:126
本文介绍了如何从BAT文件调用Visual Studio 2017 RC的MSBuild版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在以下位置找到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

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆