How to Fix: Why does MSBuild look in C:\ for Microsoft.Cpp.Default.props instead of c:\Program Files (x86)\MSBuild? ( error MSB4019)
MSBuild looks for Microsoft.Cpp.Default.props in C:\ instead of Program Files (x86)\MSBuild due to a misconfigured VCTargetsPath. Update the path to include the correct location.
📋 Table of Contents
The error MSB4019 occurs when the MSBuild tool fails to locate the Microsoft.Cpp.Default.props file, which is expected to be in a specific location. The issue arises from the way the path to this file is set in the HKLM/software registry.
🛑 Root Causes of the Error
- The path to Microsoft.Cpp.Default.props is set in the HKLM/software registry, but it points to a 32-bit location (c:\\\MSBuild) instead of the 64-bit location.
🛠️ Step-by-Step Verified Fixes
Method 1: Update the registry path
- Step 1: Open the Registry Editor (
regedit.exe) and navigate toHKEY_LOCAL_MACHINE/software\\\Microsoft\\\MSBuild\\\ToolVersions\V4.0\VCTargetsPath.
Method 1: Update the registry path (continued)
- Step 2: In the right-hand pane, find the value
VCTargetsPathand double-click it to edit its value.
Method 1: Update the registry path (continued)
- Step 3: In the Value data field, update the path to point to the 64-bit location:
${MSBuildExtensionsPath64}\\\Microsoft.Cpp\v4.0.
🛠️ Step-by-Step Verified Fixes (continued)
Method 2: Set the path manually
- Step 1: Create a new file named
MSBuildExtensionsPath64.txtin the root of your user directory (C:\\\Users\\\\).\\\AppData\\\Roaming\Microsoft\\\MSBuildExtensionsPath64.txt
Method 2: Set the path manually (continued)
- Step 2: In this file, set the value to point to the 64-bit location:
${MSBuildExtensionsPath64}\\\Microsoft.Cpp\v4.0.
💡 Conclusion
By updating the registry path or setting it manually, you should be able to resolve the MSB4019 error and build your VC2010 project successfully.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid