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. 搞定了。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值