Visual studio 2017添加引用时报错未能正确加载ReferenceManagerPackage包的解决方法

(编辑:jimmy 日期: 2024/10/15 浏览:2)

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

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

未能正确加载“ReferenceManagerPackage”包。

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

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

继续显示此错误消息吗"text-align: center">Visual studio 2017添加引用时报错未能正确加载ReferenceManagerPackage包的解决方法

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添加引用时报错未能正确加载ReferenceManagerPackage包的解决方法

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添加引用时报错未能正确加载ReferenceManagerPackage包的解决方法

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

希望对你有帮助!

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

一句话新闻

一文看懂荣耀MagicBook Pro 16
荣耀猎人回归!七大亮点看懂不只是轻薄本,更是游戏本的MagicBook Pro 16.
人们对于笔记本电脑有一个固有印象:要么轻薄但性能一般,要么性能强劲但笨重臃肿。然而,今年荣耀新推出的MagicBook Pro 16刷新了人们的认知——发布会上,荣耀宣布猎人游戏本正式回归,称其继承了荣耀 HUNTER 基因,并自信地为其打出“轻薄本,更是游戏本”的口号。
众所周知,寻求轻薄本的用户普遍更看重便携性、外观造型、静谧性和打字办公等用机体验,而寻求游戏本的用户则普遍更看重硬件配置、性能释放等硬核指标。把两个看似难以相干的产品融合到一起,我们不禁对它产生了强烈的好奇:作为代表荣耀猎人游戏本的跨界新物种,它究竟做了哪些平衡以兼顾不同人群的各类需求呢?