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

后端 未结 10 785
南方客
南方客 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条回答
  • 2020-12-07 14:09

    I used C:\Windows\SysWOW64\regedit.exe and went to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\3.5 and in the folder for version 3.5 it had 2.0 listed in the defaulttoolsversion so I modified that to 3.5 and everything works now.

    0 讨论(0)
  • 2020-12-07 14:12

    I also suffered from the missing registry values under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0.

    Adding the missing entries with the following commands fixed it.

    REG ADD HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 /v VCTargetsPath /t REG_SZ /d '$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\14.0@VCTargetsPath)'
    REG ADD HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 /v VCTargetsPath14 /t REG_SZ /d '$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\14.0@VCTargetsPath14)'
    
    0 讨论(0)
  • 2020-12-07 14:15

    The registry editing method suggested by "Mladen Jankovic" didn't work for me.

    I just ran a repair on Visual Studio 2010 (run the setup.exe on the VS2010 install disc, or invoke the 'uninstall' via Control Panel->Programs). It did the trick for me.

    You also should run the SP1 install again.

    For what it's worth, my 'add-ins' (including Incredibuild) behaved fine after this. They didn't need to be reinstalled or repaired. My settings/window/debugger placement also was retained.

    Apparently this issue only presents itself if you uninstall the Developer Preview of VS11: http://www.gamefromscratch.com/post/2011/12/15/Do-not-remove-Visual-Studio-2011-developer-preview!.aspx

    0 讨论(0)
  • 2020-12-07 14:17

    I've been having this same issue, and found out that the toolset tag was not set in the project node

    Setting the tools version solved it for me

    0 讨论(0)
  • 2020-12-07 14:26

    Here's the thing that did trick for me:

    Change registry value named DefaultToolsVersion located in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\4.0 from 2.0 to 4.0. Do the same thing in Wow6432Node too.

    0 讨论(0)
  • 2020-12-07 14:29

    I arrived here when trying to build a c++ project without the c++ Visual Studio build tools installed. My solution was to download the Visual Studio Build Tools installer from the downloads page under 'Tools for Visual Studio 2017' tab, running the installer with the"Visual C++ build tools" and ".NET Desktop Build Tools" options.

    0 讨论(0)
提交回复
热议问题