Visual Studio 2019: Still have a MSB8020 error after retarget project to v142

Harry 101 Reputation points
2020-12-16T08:31:02.233+00:00

After a new installation of Visual Studio 2019 on a blank machine, I had retarget my project and also set the correct SDK version.

48691-image.png

But when I try to compile the project, I still get the MSB8020 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".  

All the solutions I have found say I should use the 2013 toolset or retarget my project to the new 2019 toolset. I don't want to use the old build toolset, but retargeting the project doesn't work for me either. I don't understand where in the project file the compiler gets the v120 toolset. I double checked that the toolset is set correctly to <PlatformToolset>v142</PlatformToolset>.

Does someone has a hint for me?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,514 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,482 questions
{count} votes

Accepted answer
  1. Harry 101 Reputation points
    2020-12-17T09:36:32.33+00:00

    I found the problem. I have a project reference in the project file that points to an old project file for 2013:

    <ProjectReference Include="..
    

    When I use a reference to the correct project file, everything works find.
    Thanks for the help!

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful