如何在Visual Studio中安装(v142)生成工具 [英] How to install (v142) Build tools in Visual studio

查看:7455
本文介绍了如何在Visual Studio中安装(v142)生成工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在Visual Studio中构建某些内容时,Visual Studio会向我显示一些警告,然后如果我忽略它并进行构建,则会发生错误.

As I am trying to build something in visual studio then visual studio show me some warning and then If i ignored it and build then error occurs.

    error MSB8020: The build tools for v142 (Platform Toolset = 'v142') 
    cannot be found. To build using the v142 build tools, please install 
    v142 build tools.

它还会向我显示一个替代选项,我也尝试过,但不起作用.

It will also show me an Alternate option I also tried it but not works.

    Alternatively, you may upgrade to the current 
    Visual Studio tools by selecting the Project menu or right-click the 
    solution, and then selecting "Retarget solution".

推荐答案

最重要的是,您需要安装Visual Studio 2019才能访问v142工具.

The bottom line is that you need to install Visual Studio 2019 to access the v142 tools.

随着Visual Studio(VS2015,VS2017,VS2019)的不同版本,Microsoft还发布了不同的构建工具版本,以继续改进编译器并提供附加功能并满足更新的语言标准(C ++,C ++ 11, C ++ 17等).请参见 Visual Studio 2015未检测到v141(2017)生成工具

Along with different versions of Visual Studio (VS2015, VS2017, VS2019), Microsoft also releases different build tool versions as they continue to improve the compiler and provide additional capabilities and to meet updated language standards (C++, C++11, C++17, etc.). See Visual Studio 2015 not detecting v141 (2017) Build tools

另请参阅此Microsoft博客文章,内容涉及VS2017的构建工具以及从VS2015访问较旧的v140,

See as well this Microsoft blog posting about build tools for VS2017 and accessing the older v140 from VS2015, Visual Studio Build Tools now include the VS2017 and VS2015 MSVC Toolsets.

许多人告诉我们,您仍然需要MSVC v140工具集 从Visual Studio 2015中继续开发较旧的代码库.我们已经 更新了Visual Studio Build Tools,以包括来自v140的工具集 Visual Studio 2015 Update 3(包括最新服务) 释放.您可能会注意到,编译器工具集的构建版本可能会 与完整的VS 2015安装中的版本不匹配,即使它们是 相同的编译器.发生这种情况是因为我们构建了完整的Visual Studio和Visual Studio生成工具位于单独的分支中,可能会 在不同的日子建造.

Many of you have told us that you still need the MSVC v140 toolset from Visual Studio 2015 to continue building older codebases. We’ve updated the Visual Studio Build Tools to include the v140 toolset from Visual Studio 2015 Update 3 including the most recent servicing release. You might notice that the compiler toolset build version may not match the version in a full VS 2015 install, even though they are the same compilers. That happens because we build the full Visual Studio and the Visual Studio Build Tools in separate branches that may be built on different days.

Visual Studio生成工具中的Visual C ++生成工具工作负载 将默认安装来自VS2017的最新v141工具集. v140 VS2015中的工具集将与v141工具集并排安装. 要安装它们,只需选择用于桌面的"VC ++ 2015.3 v140工具集" (x86,x64)"位于可选"部分底部.

The Visual C++ build tools workload in the Visual Studio Build Tools will install the latest v141 toolset from VS2017 by default. The v140 toolset from VS2015 will install side-by-side with the v141 toolset. To install them just select the "VC++ 2015.3 v140 toolset for desktop (x86,x64)" at the bottom of the "Optional" section.

就您而言,V142构建工具随VS2019一起发布.似乎v142不可用于VS2017. VS2017的最新构建工具看起来是v141.

In your case, V142 build tools was released with VS2019. It does not appear that v142 is available for VS2017. The most recent build tools for VS2017 looks to be v141.

您可以使用Visual Studio安装程序通过在列表中添加或删除列表来修改可用的生成工具.该SO发布描述了类似的问题,但在VS2015 Visual Studio安装中缺少v140. MSbuild错误:构建工具找不到v140(平台工具集='v140')

You can use the Visual Studio installer to modify the build tools available by adding or removing from the list. This SO posting describes a similar problem but with v140 missing in a VS2015 Visual Studio installation. MSbuild Error: The builds tools for v140 (Platform Toolset = 'v140') cannot be found

但是,如果Microsoft尚未针对您使用的Visual Studio发布特定的构建工具版本,则它将不会显示在可用工具集列表中.

However if Microsoft has not released a particular Build Tools version for the Visual Studio you are using then it will not show in the list of available toolsets.

作为一个旁注,在对这个问题进行一些发现的同时,我发现一些文章表明,如果您安装了最新的Visual Studio,然后安装了早期版本的Visual Studio,则默认目标生成工具可以还要更改为较早安装的构建工具.

As a side note, while doing a bit of discovery on this question, I have found some articles that indicate that if you have a recent Visual Studio installed and then install an earlier version of Visual Studio, the default target build tools can also change to the build tools for the earlier install.

换句话说,如果您已经安装了VS2019,其默认目标为v142,然后再安装VS2017,则默认目标将更改为v141,要求您在使用VS2019时将构建目标实际设置为v142.

In other words, if you have VS2019 with a default target of v142 already installed and then install VS2017, the default target will change to v141 requiring you to actually set the build target to v142 when using VS2019.

从VS2015开始,Microsoft似乎提供了标准的Visual Studio引擎,在VS 2015,VS2017和VS2019之间共享,并且构建工具和各种组件已更新以提供新功能,新语言标准合规性. Visual Studio版本与Visual Studio版本可以使用的构建工具和组件之间存在依赖关系. v142在VS2017中不可用,很可能是为了鼓励人们购买新产品.

It looks like beginning with VS2015, Microsoft is providing a standard Visual Studio engine that is shared among VS 2015, VS2017, and VS2019 with build tools and various components being updated to provide new features and functionality and new language standards compliance. There are dependencies between the Visual Studio version and what build tools and components can be used with the Visual Studio version, e.g. v142 is not available for VS2017, most probably to provide an incentive for purchasing the newer product.

这篇关于如何在Visual Studio中安装(v142)生成工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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