4

I have a Problem which pretty much the bears same anatomy as this post:

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

Adding the registry (as per the suggestion from Peter Kahn in that other post) did not appear to help, even though it was previously missing. I do have all the files in the correct directory, that is

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

See, if I chose 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, in theory, end up with the directory where 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 puzzling: If the $(MSBuildExtensionsPath) is changed to something not in c:\Program Files (X86)\ - for example this:

MSBuildExtensionsPath32 = C:\test\MSBuild

The resulting error message changes and surprisingly, the path is collated properly:

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

Interestingly, this file in fact does exist (copied it there..) and it is still not found. WTH is wrong?

Community
  • 1
  • 1
antipattern
  • 743
  • 1
  • 9
  • 20

1 Answers1

1

Although I hate as much as anyone else uninstalling and reinstalling stuff, https://stackoverflow.com/a/16213408/239408 worked for me and did not require any troubleshooting...

Community
  • 1
  • 1
xverges
  • 4,608
  • 1
  • 39
  • 60
  • 1
    Isn't is stupid to install full Visual Studio when you just need MSBuild tools? – Green Nov 16 '16 at 13:36
  • 1
    @Green, maybe it is stupid. And maybe you could post a more informative comment. In July 2013, having Visual Studio was still the only published approach for my compilation needs https://github.com/nodejs/node-gyp/commit/088082766caf7562540d0cf1ef7960a7f11995c9#diff-04c6e90faac2675aa89e2176d2eec7d8 – xverges Nov 20 '16 at 08:59
  • @xverges that doesn't mean that it's not stupid and a bad design choice by Microsoft – starscream_disco_party Aug 20 '19 at 19:17