无法在VS 2017 U1(15.3)中打开的项目上加载类型'Microsoft.Build.Framework.SdkReference' [英] Could not load type 'Microsoft.Build.Framework.SdkReference' on project open in VS 2017 U1 (15.3)

查看:102
本文介绍了无法在VS 2017 U1(15.3)中打开的项目上加载类型'Microsoft.Build.Framework.SdkReference'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从VS 2017 15.1升级到15.3(显然很成功)之后,我无法再加载任何C#项目(无法打开现有项目,无法创建新项目)。所有人均因以下错误而失败:


无法从程序集 Microsoft.Build.Framework中加载类型 Microsoft.Build.Framework.SdkReference,版本= 15.1.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a'。 RC版本15.3,但没有其他版本,因此我不知道我的环境可能导致此问题。我曾尝试清除缓存和用户数据,修复,完成卸载/重新安装以及删除第3方组件。我没主意。



我绝对可以在这里提供大量信息,所以我不确定从哪里开始。我非常感谢您提出任何想法,或者至少想看看是否有人遇到了同样的问题。

解决方案

使用管理员 VS 2017的开发人员命令提示符

  gacutil / u Microsoft.Build.Framework,版本= 15.1 

将新版本重新安装到GAC。 MSBuild不应放在GAC中,并且在下次Visual Studio更新MSBuild时将其安装在其中会引起问题,因为来自GAC的文件比Visual Studio随附的更新版本更受欢迎。


After doing an (apparently successful) upgrade from VS 2017 15.1 to 15.3, I can no longer load any C# project (can't open existing, can't create new). All fail with this error:

Could not load type 'Microsoft.Build.Framework.SdkReference' from assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

I found one reference to someone running into this problem with an RC version of 15.3, but no others, so I've got no idea what about my environment might be causing this problem. I've tried clearing cache and user data, repair, complete uninstall/reinstall, and removing 3rd party components. I am out of ideas.

There's absolutely tons of info I could provide here, so I'm not sure where to start. I'm grateful for any ideas or at least to see if others are running into the same problem.

解决方案

Use an adminstrator "Developer Command Prompt for VS 2017" to run

gacutil /u "Microsoft.Build.Framework, Version=15.1"

Please do not reinstall another version to the GAC. MSBuild should not be in the GAC, and installing it there will cause problems the next time Visual Studio updates MSBuild, because the file from the GAC gets preferred over the updated version delivered with Visual Studio.

这篇关于无法在VS 2017 U1(15.3)中打开的项目上加载类型'Microsoft.Build.Framework.SdkReference'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆