如何在不安装 IDE 的情况下在构建服务器上安装 VS2017 版本的 msbuild? [英] How can I install the VS2017 version of msbuild on a build server without installing the IDE?

查看:14
本文介绍了如何在不安装 IDE 的情况下在构建服务器上安装 VS2017 版本的 msbuild?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从历史上看,这是通过 Microsoft Build Tools.但似乎 构建工具可能不适用于 2015 年之后的版本.替代品似乎是 Visual Studio 构建工具,它似乎还没有真正的主页.

Historically, this has been done with the Microsoft Build Tools. But it seems that the Build Tools may not be available for versions after 2015. The replacement appears to be the Visual Studio build tools, which doesn't seem to have a real homepage yet.

我下载了VS2017 Professional 安装程序,然后去了Individual Components 选项卡.马上,摘要告诉我 Visual Studio 核心编辑器在那里,占用 753MB.我不要编辑器.只是msbuild.无法取消选择编辑器.

I downloaded the VS2017 Professional installer, and went to the Individual Components tab. Right away, the summary is telling me that the Visual Studio core editor is there, taking up 753MB. I don't want the editor. Just msbuild. There is no way to unselect the editor.

有没有一种方法可以在不安装 Visual Studio IDE 的情况下安装最新版本的 msbuild?

Is there a way I can install the latest version of msbuild without also installing the Visual Studio IDE?

推荐答案

Visual Studio 构建工具的下载方式与 IDE 不同.它们似乎是一个很小的子集,它们被称为 Build Tools for Visual Studio 2019(下载).

The Visual Studio Build tools are a different download than the IDE. They appear to be a pretty small subset, and they're called Build Tools for Visual Studio 2019 (download).

您可以使用 GUI 进行安装,也可以编写 msbuild 安装脚本:

You can use the GUI to do the installation, or you can script the installation of msbuild:

vs_buildtools.exe --add Microsoft.VisualStudio.Workload.MSBuildTools --quiet

Microsoft.VisualStudio.Workload.MSBuildTools你需要的三个子组件:

  • Microsoft.Component.MSBuild
  • Microsoft.VisualStudio.Component.CoreBuildTools
  • Microsoft.VisualStudio.Component.Roslyn.Compiler

您可以找到有关其他可用 CLI 开关的文档 这里.

You can find documentation about the other available CLI switches here.

构建工具的安装比完整的 IDE 快很多.在我的测试中,它需要 5-10 秒.使用 --quiet 除了简短的光标更改外,没有进度指示器.如果安装成功,您应该可以在 %programfiles(x86)%Microsoft Visual Studio2019BuildToolsMSBuildCurrentBin 中看到构建工具.

The build tools installation is much quicker than the full IDE. In my test, it took 5-10 seconds. With --quiet there is no progress indicator other than a brief cursor change. If the installation was successful, you should be able to see the build tools in %programfiles(x86)%Microsoft Visual Studio2019BuildToolsMSBuildCurrentBin.

如果您在那里看不到它们,请尝试在不使用 --quiet 的情况下运行以查看安装过程中可能出现的任何错误消息.

If you don't see them there, try running without --quiet to see any error messages that may occur during installation.

这篇关于如何在不安装 IDE 的情况下在构建服务器上安装 VS2017 版本的 msbuild?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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