我的vs包没有正确加载

问题描述 投票:17回答:5

我有一个我开发并与早期版本的Visual Studio一起使用的插件,我已经设法在VS和VS 2015之间开发了一个接口。从我的“Command”类,我有一个回调函数,包含对库(.dll)中相应函数的调用以获取插件。插件还有另一个促进库(.dll)。

在实验实例中,一切似乎都运行良好,现在我正在尝试创建一个安装和分发包。

这适用于在Windows 10上运行的Visual Studio 2015 Community Edition。

当我双击.vsix文件时,我收到以下警告:

此扩展程序不包含数字签名。


此扩展未在其清单中指定可由VSIX Installer读取的许可条款。


无论如何我装了它。

当我调用我的一个函数时,我收到以下错误消息:

'Commands_01Package'包未正确加载。

问题可能是由配置更改或安装另一个扩展引起的。您可以通过检查文件“C:\ Users \ ... \ 14.0 \ ActivityLog.xml”来获取更多信息。

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

这些是“C:\ Users \ ... \ 14.0 \ ActivityLog.xml”底部的条目:

  <entry>
    <record>437</record>
    <time>2016/04/20 04:38:41.710</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
    <guid>{A683C1FD-D1DC-4790-9A79-EF3A06CA0FEB}</guid>
  </entry>
  <entry>
    <record>438</record>
    <time>2016/04/20 04:38:41.711</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [Command_01Package]</description>
    <guid>{A683C1FD-D1DC-4790-9A79-EF3A06CA0FEB}</guid>
  </entry>
  <entry>
    <record>439</record>
    <time>2016/04/20 04:38:44.626</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
    <guid>{30D5B2E6-64BF-422F-A2BF-5D5B4D66548F}</guid>
  </entry>
  <entry>
    <record>440</record>
    <time>2016/04/20 04:38:44.626</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [Settings Store Synchronization Delayed Init Package]</description>
    <guid>{30D5B2E6-64BF-422F-A2BF-5D5B4D66548F}</guid>
  </entry>
  <entry>
    <record>441</record>
    <time>2016/04/20 04:38:44.626</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>End package load [Settings Store Synchronization Delayed Init Package]</description>
    <guid>{30D5B2E6-64BF-422F-A2BF-5D5B4D66548F}</guid>
  </entry>
  <entry>
    <record>442</record>
    <time>2016/04/20 04:38:45.926</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [Command_01Package][The type initializer for
    &apos;Wilson_Addin_01.Main_Module&apos; threw an exception.]:
    {   at Wilson_VSIX_01.Command_01.Initialize(Package package)
    in I:\Visual Studio\VS_Packages\Wilson_VS_Pkg_01\Wilson_VSIX_01\Wilson_VSIX_01\Command_01.cs:line 116&#x000D;&#x000A;
    at Wilson_VSIX_01.Command_01Package.Initialize()
    in I:\Visual Studio\VS_Packages\Wilson_VS_Pkg_01\Wilson_VSIX_01\Wilson_VSIX_01\Command_01Package.cs:line
    69&#x000D;&#x000A;
    at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite
    (IServiceProvider sp)}[Could not load type &apos;MacroXMLLib01.VS_XML_Lib_01_NS.cls_path_verification&apos;
    from assembly &apos;MacroXMLLib01, Version=1.0.0.0, Culture=neutral, PublicKeyToken=21ecbe15a2364220&apos;.]:
    {   at Wilson_Addin_01.XML_ctrl_module.VS_Link_XML_class..ctor(String&amp; p_XML_path, String&amp;
    p_XML_file)&#x000D;&#x000A;
    at Wilson_Addin_01.Main_Module..cctor()}</description>
    <guid>{A683C1FD-D1DC-4790-9A79-EF3A06CA0FEB}</guid>
    <hr>80131534</hr>
    <errorinfo></errorinfo>
  </entry>
  <entry>
    <record>443</record>
    <time>2016/04/20 04:38:47.141</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>End package load [Command_01Package]</description>
    <guid>{A683C1FD-D1DC-4790-9A79-EF3A06CA0FEB}</guid>
    <hr>80131534</hr>
    <errorinfo></errorinfo>
  </entry>
</activity>

我对VS Packages几乎一无所知。如果微软没有放弃对插件的支持,我根本不会为此烦恼,而且为了保留旧版本的功能,我必须投入时间和精力来实现这一点似乎很荒谬。 VS.

对不起,如果这看起来像一个愚蠢的问题,但缺少数字签名是否与“SetSite失败的包”有关?

如果是这样,那么我需要做什么才能获得数字签名?

对此的任何帮助将非常感激。

visual-studio-2015 visual-studio-addins vspackage
5个回答
30
投票
  1. 关闭Visual Studio的所有实例
  2. 删除此文件夹C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache中的所有内容
  3. 重新启动Visual Studio
  4. 在Visual Studio中重新加载项目

11
投票

检查C:\Users\%username%\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml

我的情况有一个类似的条目

  <entry>
    <record>476</record>
    <time>2017/01/25 05:57:06.105</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>LegacySitePackage failed for package [VSPackage]Source: &apos;Microsoft.VisualStudio.ApplicationInsights&apos; Description: Could not load type &apos;Microsoft.VisualStudio.ApplicationInsights.Interfaces.IApplicationInsightsSearchService&apos; from assembly &apos;Microsoft.VisualStudio.ApplicationInsights.Interfaces, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;.&#x000D;&#x000A;System.TypeLoadException: Could not load type &apos;Microsoft.VisualStudio.ApplicationInsights.Interfaces.IApplicationInsightsSearchService&apos; from assembly &apos;Microsoft.VisualStudio.ApplicationInsights.Interfaces, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;.&#x000D;&#x000A;   at Microsoft.AppInsights.GettingStarted.VSPackage.Initialize()&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)</description>
    <guid>{1A4EFADE-F6B2-4490-A2EF-21D5F3D1C8E0}</guid>
    <hr>80131522</hr>
    <errorinfo></errorinfo>
  </entry>

在“已安装”插件中的“工具 - >扩展和更新”下的搜索栏中检查“洞察”字后,它向我显示了插件“开发者分析工具”。删除了这个插件,问题就消失了。


3
投票

我和第三方包有类似的问题。

按照有关从'\ Common7 \ IDE \ Extensions'删除的在线步骤后,我仍然收到错误。

他们告诉我打开vs命令提示符并运行的最后一步:

devenv /UpdateConfiguration

错误消失了。


0
投票

删除文件夹中的所有文件,(14.0 - VS2017)C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\14.0

它100%为我工作。


0
投票

我解决了这个问题升级Visual Studio(不兼容问题)。为了做到这一点:

  • 启动Visual Studio安装程序
  • 单击“更新”
© www.soinside.com 2019 - 2024. All rights reserved.