Visual Studio 2013 错误 MS8020 Build tools v140 找不到

Visual Studio 2013 error MS8020 Build tools v140 cannot be found

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

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

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

完整的错误信息见下方

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

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

要更改您的平台工具集:

  1. 右键单击您的项目,转到“属性”。
  2. 在配置属性下,转到常规。
  3. 将您的平台工具集更改为可用的工具集之一。

@bku_drytt的解决方案没有为我做。

我通过在 .vcxproj 文件中手动将 14.0 的每次出现更改为 12.0 并将 v140 更改为 v120 来解决它。

然后就编译成功了!