Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
253 views
in Technique[技术] by (71.8m points)

c# - Could not load type 'Microsoft.Build.Framework.SdkReference' on project open in VS 2017 U1 (15.3)

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

1.- Open Developer Command Prompt for VS2017 as Admin

2.- Uninstall the Microsoft.Build.Framework from GAC (Global Assembly Cache)

gacutil /u Microsoft.Build.Framework

3.- Re-install the 15.1.0 version (correct path according to current VS2017 edition)

gacutil /i "C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0BinMicrosoft.Build.Framework.dll"

Now the projects in solutions should load properly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...