MSBuildToolsPath is not specified for the ToolsVersion

Written by quinn on Posted in Tips, Tricks & Techniques

Q. When I try to compile any Delphi or C++ project I get the following error:

[Fatal Error] MSBuildToolsPath is not specified for the ToolsVersion "14.0" defined at "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0", or the value specified evaluates to the empty string.

How do I resolve this error?

A. This error is caused by incorrect values in the registry. On a 32 OS, run regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild. On a 64 bit OS, run regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild. First, backup this registry key by selecting File | Export. Next, look at the numbers below the ToolsVersions key. Delete any number not found at the MSBuild level.

For example, here is an example of incorrect values in the registry:

Note how 14.0 appears below ToolsVersions, but does not appear at the MSBuild level. This is the problem.

Here is an example of the above registry key after it has been corrected:

There is anecdotal evidence to suggest this registry key imbalance is caused by uninstalling some versions of Visual Studio, but it has not been confirmed at this time.

Gold User, Rank: 35, Points: 77
Support guy since 3/18/85. It was dBASE II/III back then.

Check out more tips and tricks in this development video: