c# - Visual Studio 无法打开或创建项目

标签 c# visual-studio-2010

当我在 Visual Studio C# 2010 Express 中打开或创建项目时出现此错误:

Cannot evaluate the property expression "$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V120\'))" found at "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0@VCTargetsPath". Invalid static method invocation syntax: "[MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V120\')". Method '[MSBuild]]::ValueOrDefault' not found. Static method invocations should be of the form: §([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(a, b)).

Error message

希望有人能解决这个问题。我尝试重新安装它,但它不起作用。我认为这与注册表有关。

最佳答案

我之前安装VS2013然后卸载时遇到了同样的问题。发生这种情况是因为 VS2013 卸载程序忘记了其中一个注册表项,这会在您再次开始使用 VS2010 时导致此错误。

如果这个位置有12.0的key就删除。

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions

希望 VS2010 能再次工作。

关于c# - Visual Studio 无法打开或创建项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26978418/

相关文章:

c# - 如何将字符串列表从 Sql 数据插入到 Document Db/cosmos db 中?

c# - 数组语义初始值设定项如何在 C# 中工作?

c++ - 性能计数器索引 windows pdh c

c# - 找不到 IObjectWithSite 的程序集

visual-studio-2010 - 使用 MSBuild 和 TeamCity 部署 VS 2010 数据库项目

c# - 为什么 Roslyn 中有这么多对象池的实现?

c# - 如何设置基本字体颜色?

C# ProcessWindowStyle.Minimized 不适用于 PSR.exe

mysql - 通过 visual studio 安装程序运行另一个 MSI

xml - Visual Studio 在 VB 中对 CDATA XML block 的可怕着色。