MSBuild does not contain a value for the “VCTargetsPath” property

后端 未结 10 826
南方客
南方客 2020-12-07 14:06

I recently installed the Visual Studio 11 Developer Preview to try it out, and now my VS 2010 projects won\'t open. Instead, I get the following error message:

10条回答
  •  旧时难觅i
    2020-12-07 14:35

    For those who are here by google search :

    If you had previously installed VS 2015 or any later versions of vs after vs2010, and then uninstalled, Here is the solution for you.

    In the error message below :

    Cannot evaluate the property expression "$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"

    14.0 is the version number of VS2015. Unfortunately, the VS2015/2012 uninstaller forgets one of its registry keys, which then causes that error when you go back to VS2010.

    Go to start/run/ regedit >

    Look for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 (12.0 as well)

    And

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\14.0 (12.0 as well )

    If there is a key 14.0/12.0 here, delete it and your VS2010 will hopefully work again.

提交回复
热议问题