50

I am unable to compile/build anything within Visual Studio C++ 2012 because I am getting an error that states either I have an inappropriate ToolsVersion or that the ToolSet is missing.

Here is the error in the console:

Project file contains ToolsVersion="12.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0".

1>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.

I have installed Microsoft SDK. This may be relevant also - I downgraded from 2013 VSRC to 2012 MSVC recently but I made a clean uninstallation.

5
  • 3
    v120 is the Visual Studio 2013 Toolset. Modify your project files to use the v110 Toolset instead (Project -> Properties -> General -> Platform Toolset). Commented Jan 2, 2014 at 15:45
  • @IInspectable Thankyou very much- that solved the second error. I thought both were connected though. Commented Jan 2, 2014 at 15:47
  • I rolled back your edits. Otherwise the question loses potentially valuable information for others. Commented Jan 2, 2014 at 15:50
  • My apologies. I forgot that the post was more for the site than the user Commented Jan 2, 2014 at 15:50
  • Open your .vcxproj file in a text editor and see if you find any occurrences of v120. Specifically, all <PlatformToolset> elements should read: <PlatformToolset>v110</PlatformToolset>. Commented Jan 2, 2014 at 16:00

2 Answers 2

54

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

Project -> Properties -> General -> Platform Toolset (as IInspectable correctly commented)

Project file contains ToolsVersion="12.0" (...) Treating the project as if it had ToolsVersion="4.0"

  1. Right-click project -> Unload Project
  2. Right-click project -> Edit (name).vcxproj
    • Change this line: <Project DefaultTargets="Build" ToolsVersion="12.0" ...
    • into: <Project DefaultTargets="Build" ToolsVersion="4.0" ...
  3. Save, close, Right-click project -> Reload Project
Sign up to request clarification or add additional context in comments.

5 Comments

SImple and not have to install any extra thing, this is the best answer
Why would one choose to do this over simply installing build tools 12? Being completely new to the VS, wouldn't setting the project to use an old (or differing) version of a build tools possibly introduce build issues?
Both answers are correct. These are instructions on how to downgrade the projects to VS2012 projects. Tod Thomson's answer allows you to build the project in VS2012 without having to edit the project files
This did not solve it for me. My vcxproj file already had ToolsVersion="4.0" set. Still this same build error persisted.
Correct solution. A small addition. Unloading and reloading the project isn't strictly needed. Simply saving the project, in Visual Studio, editing the vcxproj as described in an text-editor and saving the project is sufficient. Visual Studio presents to reload the project on detecting the vcxproj has been changed externally.
29

Try Microsoft Build Tools 2013 for building ToolsVersion="12.0" projects here:

http://www.microsoft.com/en-au/download/details.aspx?id=40760

It might help you get going.

5 Comments

This one solved my problem on building .NET projects on Jenkins.
Even after installing the Microsoft Build Tools 2013, I cannot build C++ projects (targeting VC++ 12 toolset) from the MSBuild command line.
"If you don't have Visual Studio installed on your computer, you can use Build Tools 2013 to build managed applications. The Visual Basic and C# compilers are also included in this download" i.e. not C++...
You can build .NET solution created with VS2013 using VS2012 after installing these tools

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.