visual-studio - MSBuild 不包含 "VCTargetsPath"属性的值

标签 visual-studio visual-studio-2010 msbuild projects-and-solutions visual-studio-2012

我最近安装了 Visual Studio 11 开发人员预览版来尝试一下,但现在我的 VS 2010 项目无法打开。相反,我收到以下错误消息:

MSBuild does not contain a value for the "VCTargetsPath" property

我发现有人报告了该问题here on Connect ,微软的回应是:

Posted by Microsoft on 12/2/2011 at 5:25 PM
Hi Afshin,

Thanks for the feedback. The issue you ran into is fixed for the next public release Visual Studio.

Jim Griesmer
Visual C++ Team

太棒了。那么如何恢复 VCTargetsPath 以便我的项目能够再次运行?

"VCTargetsPath is a toolset property that is defined in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0. "

我浏览到注册表中的 VCTargetPath 值,它的值是:

$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\

不知道从这里去哪里。有什么建议吗?

最佳答案

Gavin Pugh 提供的解决方案似乎可以解决问题,但我没有尝试。我在卸载 VS11 的开发者预览版后也遇到了这个问题。我想我知道真正的问题是什么。

姆拉登·扬科维奇走在正确的道路上。我的计算机上缺少以下两个(必要的)注册表项之一:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
    • key 名称:VCTargetsPath
    • 类型:REG_SZ
    • 值:$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\
  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\4.0
    • key 名称:VCTargetsPath
    • 类型:REG_SZ
    • 值:$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\

(您可以通过键入 enter image description here +R+regedit+Enter 在 Windows 中编辑注册表项)

对我来说,上面列出的第二个值是缺失的。添加后,我就可以再次使用我的项目了。

关于visual-studio - MSBuild 不包含 "VCTargetsPath"属性的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8497931/

相关文章:

c# - 禁用工具条下拉按钮的选择和下拉符号

c++ - 在 Visual Studio 2010 中链接 libavformat

MSBuild:星号和奇怪的 ItemGroup 排除行为

django - 无法发布到 azure

asp.net - mysql基于用户类别(角色/成员)的授权

visual-studio-2010 - Visual Studio 文本编辑器中的 "col"值是多少

visual-studio - 如何使用 Visual Studio 网站项目进行 Web.config 转换?

asp.net - 当我尝试调试 VS 2008 应用程序时,为什么会弹出 VS 2010 调试器?

msbuild - aspnet_compiler 和 msbuild.exe

.net - 在没有安装 VS 的情况下运行 msbuild