C++ 找不到 Visual Studio 2013 错误 MS8020 构建工具 v140

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31792663/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 14:01:44  来源:igfitidea点击:

Visual Studio 2013 error MS8020 Build tools v140 cannot be found

c++visual-studio-2013buildmsbuild

提问by Nectar Zuzi

I had previously been using VS2013 express without issue, but suddenly it began crashing whenever I tried edit the code while it ran existing code fine.

我以前一直在使用 VS2013 express 没有问题,但是每当我尝试编辑代码时它突然开始崩溃,同时它运行现有代码。

I tried uninstalling and switching over to VS2015, but it was crashing as well and wasn't compatible with some of my code. So I uninstalled VS2015 and reinstalled VS2013.

我尝试卸载并切换到 VS2015,但它也崩溃了并且与我的某些代码不兼容。所以我卸载了VS2015并重新安装了VS2013。

The new issue is whenever I try to build a solution it gives the error "MS8020".

新问题是每当我尝试构建解决方案时,它都会出现错误“MS8020”。

The full error message is seen below

完整的错误消息如下所示

Error 1 error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 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 "Upgrade Solution...". C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets 64 5 Bevan

错误 1 ​​错误 MSB8020:找不到 v140 的构建工具(平台工具集 = 'v140')。要使用 v140 构建工具进行构建,请安装 v140 构建工具。或者,您可以通过选择“项目”菜单或右键单击解决方案,然后选择“升级解决方案...”来升级到当前的 Visual Studio 工具。C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets 64 5 Bevan

回答by bku_drytt

That's the platform toolset for VS2015. You uninstalled it, therefore it is no longer available.

这是 VS2015 的平台工具集。您卸载了它,因此它不再可用。

To change your Platform Toolset:

要更改您的平台工具集:

  1. Right click your project, go to Properties.
  2. Under Configuration Properties, go to General.
  3. Change your Platform Toolset to one of the available ones.
  1. 右键单击您的项目,转到属性。
  2. 在配置属性下,转到常规。
  3. 将您的平台工具集更改为可用工具集之一。

回答by JCH2k

@bku_drytt's solution didn't do it for me.

@bku_drytt 的解决方案对我不起作用。

I solved it by additionally changing every occurence of 14.0to 12.0and v140to v120manually in the .vcxproj files.

我通过在 .vcxproj 文件中手动更改14.0to12.0v140to 的每次出现来解决它v120

Then it compiled!

然后就编译了!