当我试图在visual studio中构建一些东西时,visual studio会显示一些警告,然后如果我忽略了它并进行构建,那么就会发生错误。
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".发布于 2020-10-09 23:39:09
我在两台不同的计算机上同时使用Visual studio 2017和visual studio 2019,并且经常遇到平台工具集的问题。
在VS 2019上,当打开使用VS2017创建的解决方案/项目时,我通常只需转到顶部菜单栏中的“项目”,然后选择“重定目标解决方案”(这可能会将平台设置为V142)。
相反,在VS 2017上,当打开使用VS2019 (platform toolset v142)创建的解决方案/项目时,为了让它能够工作,我需要将其“降级”到platform v141。为此,我在项目(而不是解决方案)上右循环,选择属性,然后选择“常规”并查找我设置为"Visual studio 2017 (v141)“的”平台工具集“,然后我可以再次编译,而不会出现错误。

https://stackoverflow.com/questions/56901371
复制相似问题