title: VS 2017 Build Tools failing with Error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found
body: <p>I'm building a new TFS build server and decided to use the VS 2017 Build Tools instead of installing the full versions of VS.  When I attempt to build our C++ projects, it throws the following error:</p>
  
  <pre><code>Error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found.
  </code></pre>
  
  <p>After many hours of research I'm no closer to resolving this issue.  I tried adding the following registry settings but it did not help.</p>
  
  <pre><code>Windows Registry Editor Version 5.00
  
  [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0]
  "VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
  "VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
  "VCTargetsPath14"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath14)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
  
  [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\11.0]
  "VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
  "VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
  
  [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\14.0]
  "VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
  "VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
  "VCTargetsPath14"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath14)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
  </code></pre>
  
  <p>I'm guessing Microsoft's installer is broken for this product. Is there a standard fix for this error or should I scrap my efforts and simply install the full versions?</p>
  
  <p>In the project file, I found this entry:</p>
  
  <pre><code>&lt;Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /&gt;
  </code></pre>
  
  <p>So, I guess this means that the variable VSTargetsPath is somehow pointing to the root of the D: drive but I haven't got a clue where that value is being set.  Our current build server does not have an environment variable set named VSTargetsPath, but it does have the missing registry entries. It also has full versions of VS installed.</p>