49

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.

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

2 Answers2

53

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
Geoff
  • 8,551
  • 1
  • 43
  • 50
Jonathan
  • 6,939
  • 4
  • 44
  • 61
  • 1
    SImple and not have to install any extra thing, this is the best answer – Andiana Dec 05 '14 at 02:07
  • 4
    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? – Tor Jul 01 '15 at 21:04
  • 1
    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 – Mick Nov 02 '15 at 07:37
  • This did not solve it for me. My vcxproj file already had ToolsVersion="4.0" set. Still this same build error persisted. – Scorb Nov 13 '15 at 23:19
  • 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. – MyGeertRo Mar 10 '19 at 21:48
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.

Tod Thomson
  • 4,773
  • 2
  • 33
  • 33
  • 7
    This one solved my problem on building .NET projects on Jenkins. – Alfredo Cavalcanti May 06 '14 at 19:59
  • Even after installing the Microsoft Build Tools 2013, I cannot build C++ projects (targeting VC++ 12 toolset) from the MSBuild command line. – janglin Jun 04 '14 at 13:30
  • 1
    "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++... – Tod Thomson Jun 04 '14 at 23:55
  • 2
    You can build .NET solution created with VS2013 using VS2012 after installing these tools – Mick Nov 02 '15 at 07:35
  • 3
    Microsoft Build Tools 2015 - https://www.microsoft.com/en-in/download/confirmation.aspx?id=48159 – Soman Dubey Mar 18 '16 at 18:28