6

This is the GitHub page where I'm trying to use msbuild.exe only it's throwing this following error:

1>------ Build started: Project: keycastow, Configuration: Debug|Win32 ------
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(379,5): error MSB8020: The build tools for Visual Studio 2013 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, please install Visual Studio 2013 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 "Retarget solution".
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Is there 2 possible options to get this on GitHub to work?

NOTE: I would prefer option number one.

  1. To update the current code to 2019 standards (would that be difficult for a beginner)?
  2. Get the current v120 build tools to work.
    • Am I missing dependencies for it to work? My current installs View
    • I've checked this thread here and downloaded Microsoft Build Tools 2013 and installed but I'm having the same problem. Seeing as I'm using 2019, I thought it best to open up a new thread.

Additional info

  • Here's a screenshot of what I've currently installed in Visual Studio 2019. View.

  • There are no options in the current version to install Microsoft Build Tools 2013 in the app itself so the installed standalone version doesn't appear here as an option.

Ste
  • 1,729
  • 1
  • 17
  • 27
  • Just a note, "v120" is not "Microsoft Build Tools 2013", but Visual C++ tooling 2013. You need to install that part of Visual Studio 2013 if you want that. Of course, you accepted the answer to upgrade to VS2019. – Lex Li Jun 23 '19 at 20:44
  • Thanks for the info. Yes, changing the 1 liner was easier on my download speed. Much much quicker. I wonder why it was giving me the wrong debug? – Ste Jun 23 '19 at 20:58

3 Answers3

11

Open the keycastow.vcxproj with notepad, change here the <PlatformToolset>v120</PlatformToolset> to <PlatformToolset>v142</PlatformToolset> to use the VC++ 2019 platform or change the version via UI

In Visual Studio, in Solution Explorer, open the shortcut menu for your project (not for your solution) and then choose Properties to open your project Property Pages dialog box.

  1. In the Property Pages dialog box, open the Configuration drop-down list and then select All Configurations.

  2. In the left pane of the dialog box, expand Configuration Properties and then select General.

  3. In the right pane, select Platform Toolset and then select the toolset you want from the drop-down list (2019 - v142 in your case)

  4. Choose the OK button.

Now you compile the project without installing anything.

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • I can't thank you enough. I'm starting a programming/game dev course soon so I wanted to get the basic's down like compiling and this was my 1st issue. I'm now going to look see how to make it x64 even though such a small utility wouldn't necessarily need it. Edit. I just opened the `keycastow.vcxproj` in VS and selected the `Release|32` type in the toolbar and clicked build, also `ctrl+B` – Ste Jun 23 '19 at 20:32
  • I think the **Build** toolbar is hidden by default so you may have to right click on the toolbar for anyone wondering. – Ste Jun 23 '19 at 20:40
  • 1
    [open configuration manager](https://learn.microsoft.com/en-US/visualstudio/ide/understanding-build-configurations?view=vs-2019#solution-configurations) and create x64 configuration – magicandre1981 Jun 24 '19 at 14:45
0

For VS2019, I had to switch from a Visual Studio Build to an MSBuild Build and then specify which MSBuild.exe the build machine would run. The default was from a different PlatformToolset.

MSBuild Solution Options

Change the Path to MSBuild to the correct MSBuild.exe; e.g.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe
ergohack
  • 1,268
  • 15
  • 27
0

Got the following error message trying to build a Visual Studio 2022 project

Error MSB8020: The build tools for v143 (Platform Toolset = 'v143') cannot be found. To build using the v143 build tools, please install v143 build tools.

Your solution and this one worked for me :-)

Visual Studio 2022 not listed in devops build solution pipeline task

  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/31294434) – Ethan Mar 19 '22 at 19:32