VS BUG(3) error MSB8020: The build tools for v142 (Platform Toolset = ‘v142‘) cannot be found.

@[TOC](VS BUG(3) 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. 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”.)

前言

程序员难免要与BUG打交道,本系列将记录自己在VS平台下代码调试过程中遇到的一些BUG,希望对大家遇到相关问题时,可以提供帮助。

一. BUG提示

1>------ 已启动生成: 项目: SoundTouch, 配置: Debug x64 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): 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.  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".
2>------ 已启动生成: 项目: soundstretch, 配置: Debug x64 ------
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): 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.  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".
========== 生成: 成功 0 个,失败 2 个,最新 0 个,跳过 0==========

二. 分析解决

这种问题一般是编译的VS版本的问题,外部工程直接导入到自己的VS平台时常见的报错,以本项目为例,原工程是V142(即VS2019)下的工程,而自己是VS2015,所以产生报错信息,不要紧张,到项目属性页改过来即可。

点击工具栏“项目”中“属性”
VS BUG(3) error MSB8020: The build tools for v142 (Platform Toolset = ‘v142‘) cannot be found._第1张图片
常规中平台工具集显示v142未安装,点击此处下拉,看到自己已安装的平台,选择v140(即VS2015)
在这里插入图片描述
VS BUG(3) error MSB8020: The build tools for v142 (Platform Toolset = ‘v142‘) cannot be found._第2张图片
点击“确定”,重新生成解决方案即可。

三. 小结

项目移植是比较常见的应用,有时候是版本需要集成某个功能,所以先借鉴一下原项目工程的思路和文件,编译成功后再进行移植到自己的工程项目,一不小心都会出现这种版本平台问题,如果工程对版本平台的库没有太高要求的话,还是可以移植成功的,如果确实需要的高版本的库,低版本恰好没有,可能就会编译不通过了。

你可能感兴趣的:(PL2:,BUG联盟,bug,c++,visual,studio,error,MSB8020,VS2015)