Cpp. Default. props" exists in only in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets".
We suggest you could install Registry Explorer extension, it could help you find related registries which are used to store macro values. In addition, you could also check related targets or props files in VS installation path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise .
I got this problem when publishing a cocos2d-x application using their command line tool, which calls MSBuild. I'm using Win 7 64-bit, VS2013 express, cocos2d-x version 3.3, .NET Framework 4.5 installed.
I fixed the problem by setting the following before running the cocos.py publish command:
SET VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120
For those who didn't follow the MS proscribed order (see Xv's answer) you can still fix the problem.
MSBuild uses the VCTargetsPath
to locate default cpp properties but cannot because the registry lacks this String Value.
Check for the String Value
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
VCTargetsPath
key. The value should = "$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\
" To fix
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
VCTargetsPath
$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\
" Note: HKLM
stands for HKEY_LOCAL_MACHINE
.
I have had the same problem recently and after installing different packages in different order it was just getting very messy. Then I have found this repo - https://github.com/felixrieseberg/windows-build-tools
npm install --global windows-build-tools
It installs Python & VS Build tools that are required to compile most node modules. It worked a treat!
A lot of the answers here apply to older versions of Visual Studio. What worked for me, if using Visual Studio 2017 Community version, was setting an environment variable called VCTargetsPath
and giving it a value of
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets
If using Visual Studio 2019 Community version,
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160
Other answers here set this variable to c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140
but I noticed in my visual studio installation, there was no folder called Microsoft.Cpp in my MSBuild folder. So keep this in mind as well as the fact that the path above is for the Community version of Visual Studio 2017.
Also, make sure that your MSBuild path in your environment variables points to the correct version of MSBuild if you're using Visual Studio 2017 Community version,
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
If you're using Visual Studio 2019 Community version,
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
Installing Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 fixed the MSB4019
errors that I was getting building on Windows7 x64.
The readme of that update states that the recommended order is
On 64-bit systems, MSBuild defaults to the following properties (where C: is SystemDrive):
MSBuildExtensionsPath = C:\Program Files (x86)\MSBuild
MSBuildExtensionsPath32 = C:\Program Files (x86)\MSBuild
MSBuildExtensionsPath64 = C:\Program Files\MSBuild
If it doesn't, it means you either have some custom third-party overrides targets installed, or your MSBuild installation is corrupted.
Things to try:
MSBuildExtensionsPath
manually as above (note the x86
part on 64-bit machines)MSBuild in an independent build tool that is frequently bundled with other tools. It may have been installed on your computer with .NET (older versions), Visual Studio (newer versions), or even Team Foundation Build.
MSBuild needs configuration files, compilers, etc (a ToolSet) that matches the version of Visual Studio or TFS that will use it, as well as the version of .NET against which source code will be compiled.
Depending on how MSBuild was installed, the configuration files may be in one or more of these paths.
As described in other answers, a registry item and/or environmental variable point must to the ToolSet path.
Occasionally, an operation like installing a tool will leave the registry and/or environmental variable set incorrectly. The other answers are all variations on fixing them.
The only thing I have to add is the environmental variable didn't work for me when I left off the trailing \
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With