1. 主页 > vs安装问题 > VS2010安装问题 >

Visual studio 出现 <Module> 的类型初始值设定项

最近电脑老旧了,突然Visual studio也不能用了。症状是,只有VS2010能用,之前Vs2013,Vs2017不能正常打开。于是修复,卸载,重装。都试了个遍。结果vs2013,vs2017都不能再正常安装了。vs2015也装不了。就剩vs2010这个独苗了。好在马上也告别这电脑了。就将就用下vs2010吧。结果一打开,连vs2010也不能用了了。报如下错误。把

VS2010\VS2012出现“”的类型初始值设定项引发异常。

这里写图片描述

1.将全部.net framework**全部**卸载掉!!!(这是重中之中) 
2.在网站上下载刚才卸载.net framework 的版本 

3.再重新安装一遍,问题就解决了!

上面这个错误没有了。但是,项目代码不能正确加载了。报如下的错:

When I open or create a project in Visual Studio C# 2010 Express I get this error:

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(ab)).

Error message

I had the same issue when I had previously installed VS2013 and then uninstalled. This happens because VS2013 uninstaller forgets one of its registry keys, which causes this error when you start to work with VS2010 again.

Delete if there is a key with 12.0 in this location.

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions

Hopefully VS2010 will work again. 搞定了。

shareimprove this answer

本文由VS软件圈(vssoft.net)发布,不代表VS软件圈立场,转载联系作者并注明出处:https://vssoft.net/vsazwt/VS2010anzhuangwenti/2020/0724/2574.html

联系我们

在线咨询:点击这里给我发消息

微信号:PREEE8

工作日:9:30-18:30,节假日休息