Why MSBuild is looking for Microsoft.Cpp.Default.props in an unrelated location

I have a problem that looks a lot like the anatomy of this post:

Why does MSBuild look like C: \ for Microsoft.Cpp.Default.props instead of c: \ Program Files (x86) \ MSBuild? (error MSB4019)

Adding a registry (as suggested by Peter Kahn in this other post) did not seem to help, even if it was previously missing. I have all the files in the correct directory, i.e.

c:\Program Files (X86)\MSBuild\Microsoft.Cpp\v4.0\V110 

See if I chose the following as MSBuildExtensionsPath

 MSBuildExtensionsPath32 = C:\Program Files (x86)\MSBuild 

together with the registry

 HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersion\4.0\VCTargetsPath=$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110 HKLM\SOFTWARE\WoW6432Node\Microsoft\MSBuild\ToolsVersion\4.0\VCTargetsPath=$(MSBuildExtensionsPath64)\Microsoft.Cpp\v4.0\V110 

This should theoretically end with the directory in which the files are stored. But in practice, MSBuild is looking somewhere else:

 error MSB4019: The imported project "C:\MSBuild\Microsoft.Cpp.props" could not be found.[..] 

Even more perplexing: if $ (MSBuildExtensionsPath) is changed to something not in c: \ Program Files (X86) \ - for example, this:

 MSBuildExtensionsPath32 = C:\test\MSBuild 

The received error message changes and, oddly enough, the path maps correctly:

 error MSB4019: The imported project "C:\test\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.default.props" could not be found.[..] 

Interestingly, this file actually exists (copied it there ..), and it is still not found. WTH wrong?

+4
source share
1 answer

Although I hate as much as someone removes and reinstalls the material, fooobar.com/questions/80665 / ... worked for me and did not need troubleshooting ...

+1
source

Source: https://habr.com/ru/post/1488722/


All Articles