MSBuild does not have a microsoft.cpp folder

6,496

I know it's been a long time since anyone said anything, but if someone still finds this problem, as I did yesterday, I found the solution on this website.

As it turned out, the way to find the file Microsoft.Cpp.Default.props and the folder Microsoft.cpp was to look in this location:

drive:\Program Files (x86)\Microsoft Visual Studio\year\edition\Common7\IDE\VC
\VCTargets\

as opposed to the common location which is C:\Program Files (x86)\MSBuild and which didn't contain the folder in my case.

In order to find the folder in that location I had to previously install Visual Studio 2017.

Then I created a system environment variable called VCTargetsPath and with the mentioned location as value.

That fixed the issue.

Share:
6,496

Related videos on Youtube

mython paster
Author by

mython paster

Updated on September 18, 2022

Comments

  • mython paster
    mython paster over 1 year

    I am trying to build some projects with some msbuild and I get an msb4019 error saying stuff like "The imported project "C:\Prog ram Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Default.props" was not found".

    All solutions I have seen mention changing some registry entries and environmental variables having to do with C:\Program Files (x86)\MSBuild\Microsoft.Cpp\, however, this folder simply does not exist for me. I have visual studio professional 2017.

    msbuild folder

    • Ramhound
      Ramhound about 5 years
      It does not appear you have all the required components required to compile a Visual C++ project installed. This is due to your VCTargetsPath path variable being incorrect. You might try to simply reinstall the Visual C++ Windows Build Tools. Since there are several different solutions this might be helpful. Seems strange the error is for an entirely different version of Visual Studio then you have installed. (VS2017 isn't V120)
    • Ramhound
      Ramhound about 5 years
    • mython paster
      mython paster about 5 years
      I tried reinstalling the build tools and it did not fix the problem. Also I don't see how my question relates to the link you posted. As I said my problem is that the Microsoft.cpp folder does not exist on my machine
    • Ramhound
      Ramhound about 5 years
      The Stack Overflow question is duplicate of this question, but Stack Overflow questions cannot be used as a duplicate candidate, so I picked a possible duplicate that indicates you need to set VCTargetsPath to the correct value.
    • mython paster
      mython paster about 5 years
      setting the env variable did not help, the variable is referencing a directory that doesn't exist on my computer, I added in a picture of how my msbuild folder looks
    • Ramhound
      Ramhound about 5 years
      It does not exist because it does not appear you have installed the Visual C++ Windows Build Tools