无法找到v120(Platform Toolset ='v120')的构建工具

cli*_*hax 102 msbuild visual-studio

在Windows 8 x64上使用visual studio 2012,这是因为msbuild被移入.net但我还没有看到如何修复它.

4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(44,5): error MSB8020: The builds tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v120 to build using the v120 build tools.    
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(44,5):
error MSB8020: The builds tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v120 to build using the v120 build tools.    
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(44,5): error MSB8020: The builds tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v120 to build using the v120 build tools.
Run Code Online (Sandbox Code Playgroud)

Kev*_*son 84

如果您安装了VS2013并且收到此错误,则可能是在调用错误的MSBuild.借助VS2013,Microsoft现在将MSBuild作为Visual Studio的一部分.有关详细信息,请参阅此Visual Studio博客文章.

特别要注意二进制文件的新位置:

在32位计算机上,可以找到它们:C:\ Program Files\MSBuild\12.0\bin

在64位计算机上,32位工具将位于:C:\ Program Files(x86)\ MSBuild\12.0\bin

以及64位工具:C:\ Program Files(x86)\ MSBuild\12.0\bin\amd64

MSBuild in %WINDIR%\Microsoft.NET\Framework\似乎无法识别VS2013(v120)平台工具集.

  • 你如何改变MSBuild的路径? (11认同)
  • 当我遇到OP中描述的相同问题时,这个答案对我来说是正确的答案. (2认同)
  • @ rharrison33当我使用VS2013命令提示符时,会使用正确版本的msbuild.运行VS2012命令提示符使用了错误的msbuild位置.不确定为什么VS2013安装了VS2012命令提示符,但需要注意的是...... (2认同)

Lex*_* Li 73

http://en.wikipedia.org/wiki/Visual_C++

您使用的是Visual C++ 2012,即v110.v120表示Visual C++ 2013.

因此,要么将项目设置更改为使用工具集v110,要么在此计算机上安装Visual Studio 2013并使用VS2013进行编译.

  • 但是,但是......即使我的机器上安装了VS 2013,我也会收到此错误! (67认同)
  • 我在构建服务器上安装了VS 2013,但仍然存在问题. (6认同)
  • 你有没有解决这个问题?我有类似的问题.如果我从TFS Team Build构建,我会得到同样的错误.但是,我可以从VS 2013 IDE和VS 2013命令提示符构建. (5认同)
  • 请注意,您的解决方案可能有多个项目.因此,通过右键单击项目(而非解决方案) - >配置属性 - >常规 - >平台工具集(这是在VS2013上),检查所有这些属性的属性 (4认同)

小智 69

如果您使用visual 2012右键单击项目名称 - >属性 - >配置属性 - >常规 - >平台工具集 - > Visual Studio 2012(v110)


Kim*_*Won 14

http://www.microsoft.com/en-US/download/details.aspx?id=40760下载并设置Microsoft Build Tools 2013

  • Microsoft Build Tools 2013仅用于构建托管应用程序 (8认同)
  • @Kim Ki Won:http://stackoverflow.com/questions/37721281/installing-platform-toolset-v120-under-visual-studio-2015 (2认同)

Lou*_*uis 7

加起来凯文和莱克斯的答案:

在开发人员和构建服务器都有Visual Studio 2013的情况下,我们遇到了类似的情况.我们的解决方案有一个VS 2013 C++项目,并且在构建于开发人员的机器或IDE内的构建服务器上时编译得很好.问题是使用TFS构建定义触发构建时.我们仍在使用旧的构建模板(版本11.1)而不是12.0.幸运的是,模板xaml文件的一个简单属性添加解决了这个问题.在序列部分"编译项目"中,有一个以...开头的xaml节点

mtbwa:MSBuild CommandLineArgument=....
Run Code Online (Sandbox Code Playgroud)

您可以添加"ToolPath"属性,并根据Kevin的回答将其指向您要调用的MSBuild.exe的正确路径.例如:

ToolPath="C:\Program Files (x86)\MSBuild\12.0\Bin"
Run Code Online (Sandbox Code Playgroud)


Man*_*ddy 5

在这上面浪费了 4 个多小时。

我有Visual Studio 2017 Enterprise,其中一个项目有以下错误:

找不到 v120 的构建工具(平台工具集 = 'v120')

为了解决上述错误,我尝试安装以下所有内容:

然而,以上都没有奏效。

后来,安装了Visual Studio 2013 Ultimate,然后一切正常。

看起来,必须使用较旧的 Visual Studio 来解决此问题。

希望能帮助到你。