The builds tools for v120 (Platform Toolset = 'v120') cannot be found

Solution 1:

If you have VS2013 installed and are getting this error, you may be invoking the wrong MSBuild. With VS2013, Microsoft now includes MSBuild as part of Visual Studio. See this Visual Studio blog posting for details.

In particular, note the new location of the binaries:

On 32-bit machines they can be found in: C:\Program Files\MSBuild\12.0\bin

On 64-bit machines the 32-bit tools will be under: C:\Program Files (x86)\MSBuild\12.0\bin

and the 64-bit tools under: C:\Program Files (x86)\MSBuild\12.0\bin\amd64

The MSBuild in %WINDIR%\Microsoft.NET\Framework\ doesn't seem to recognize the VS2013 (v120) platform toolset.

Solution 2:

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

You are using Visual C++ 2012 which is v110. v120 means Visual C++ 2013.

So either you change the project settings to use toolset v110, or you install Visual Studio 2013 on this machine and use VS2013 to compile it.

Solution 3:

if you are using visual 2012 right-click on project name -> properties -> configuration properties -> general -> platform toolset -> Visual Studio 2012 (v110)

Solution 4:

Download and setup Microsoft Build Tools 2013 from http://www.microsoft.com/en-US/download/details.aspx?id=40760

Solution 5:

To add up to Kevin and Lex's answers:

We had a similar situation at work where both the developers and the build server had Visual Studio 2013. Our solution had a VS 2013 C++ project and compiled fine when built on developer's machine or on the build server within the IDE. The issue was when triggering builds using TFS build definitions. We were still using an old build template (version 11.1) instead of 12.0. Fortunately, a simple attribute addition to the template xaml file solved the issue. In the Sequence portion "Compile the Project", there is a xaml node that starts with

mtbwa:MSBuild CommandLineArgument=....

You can add a "ToolPath" attribute and point it to the right path of the MSBuild.exe you wish to invoke, based on Kevin's answer. For instance:

ToolPath="C:\Program Files (x86)\MSBuild\12.0\Bin"