温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Visual studio 2017添加引用时报错怎么办

发布时间:2021-07-12 13:44:01 来源:亿速云 阅读:330 作者:小新 栏目:开发技术

小编给大家分享一下Visual studio 2017添加引用时报错怎么办,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

最近新装了2017,开始前几天还好,可是最近在添加引用时,报错

---------------------------
Microsoft Visual Studio
---------------------------

未能正确加载“ReferenceManagerPackage”包。

此问题可能是因配置更改或安装另一个扩展导致的。可通过查看文件“C:\Users\Administrator\AppData\Roaming\Microsoft\VisualStudio\15.0_3dfc125b\ActivityLog.xml”来获取详细信息。

重新启动 Visual Studio 可帮助解决此问题。

继续显示此错误消息吗?
---------------------------
是(Y) 否(N)
---------------------------

找了百度及google 最后终于让我找到了 解决方案 原文:

安装完visual studio 2017 后添加引用总是提示 未能加载包ReferenceManagerPackage,这个问题困扰了两天,直到在网上看到了下面这一段

Visual studio 2017添加引用时报错怎么办

I just got this error after installation of Visual Studio 2017.

The solution was as follows.

  • Launch Developer Command Prompt for VS 2017

  • CD C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies

  • Run gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll

You should now see

Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Assembly successfully added to the cache
Restart Visual Studio and hopefully all will be well and you can add references.

The file C:\Users\USER\AppData\Roaming\Microsoft\VisualStudio\15.0_cc9cc69a\ActivityLog.xml is useful for debugging any other assemblies that may be causing the issue. Annoyingly it's very tempting to click No when asked never to see the error message again, which will suppress the error and this path so I thought I'd post it here for reference.

废话不多说,来看下具体的解决方案:

1、打开VS2017下的Developer Command Prompt for VS 2017

Visual studio 2017添加引用时报错怎么办

2、然后在CMD窗口输入

CD CD C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies 然后回车(注:这里的CD C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies 是你的安装目录下的路径 , 如:我是安装在D盘下的VS017,那么我的路径就是 D:\工作软件\vs2017\Common7\IDE\PublicAssemblies)

然后回车

3、再然后在CMD窗口输入 gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll 回车,得到下图的结果

Visual studio 2017添加引用时报错怎么办

4、最后一步,重启VS2017 就OK了!

以上是“Visual studio 2017添加引用时报错怎么办”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI