我的vs包没有正确加载

时间:2016-04-20 05:16:09

标签: visual-studio-2015 visual-studio-addins vspackage

我有一个我开发并使用早期版本的Visual Studio的插件, 我已经成功开发了它与VS 2015 VS套件之间的接口。 从我的“Command”类,我有一个回调函数,它包含一个调用 库中的相应函数(.dll)用于插件。还有另一种 为插件提供库(.dll)。

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

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

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

  

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

           

此扩展程序未在其清单中指定许可条款   可由VSIX安装程序读取。

     

我装了它。

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

  

'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包裹失败”有什么关系?

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

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

5 个答案:

答案 0 :(得分:30)

  1. 关闭所有Visual Studio实例
  2. 删除此文件夹C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
  3. 中的所有内容
  4. 重新启动Visual Studio
  5. 在Visual Studio中重新加载项目

答案 1 :(得分: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>

检查了&#39;见解&#39; &#39;工具 - &gt;下搜索栏中的字词扩展和更新&#39;在已安装的&#39;之中插件,它向我展示了插件&#39; Developer Analytics Tools&#39;。删除了这个插件,问题就消失了。

答案 2 :(得分:3)

我遇到了与第三方软件包类似的问题。

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

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

devenv /UpdateConfiguration

错误消失了。

答案 3 :(得分:0)

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

它100%为我工作。

答案 4 :(得分:0)

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

  • 启动Visual Studio安装程序
  • 点击更新
相关问题