Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My vs package did not load correctly

I've got an addin that I developed and used with earlier versions of Visual Studio, and I've managed to develop an interface between it and a VS Package for VS 2015. From my "Command" class, I have a callback function that wraps a call to the corresponding function within the library (.dll) for the addin. There is another facilitating library (.dll) for the addin.

Everything seems to work well enough within the experimental instance, and now I'm trying to create a package for installation and distribution.

This is for Visual Studio 2015 Community Edition running on Windows 10.

When I double-clicked the .vsix file, I got the following warning:

This extension does not contain a digital signature.


This extension did not specify license terms in its manifest that are readable by VSIX Installer.


I loaded it anyway.

When I invoked one of my functions, I got the following error message:

The 'Commands_01Package' package did not load correctly.

The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file "C:\Users\ ... \14.0\ActivityLog.xml".

Restarting Visual Studio could help resolve this issue.

These are the entries at the bottom of "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>

I know next to nothing about VS Packages. I wouldn't be bothering with this at all if Microsoft hadn't dropped support for addins, and it seems ridiculous that I have to put in the time and effort to get this working in order to retain the functionality that I had with older versions of VS.

Excuse me if this seems like a stupid question, but does the lack of a digital signature have anything to do with the "SetSite failed for package"?

If so, then what do I need to do to get a digital signature?

Any assistance with this would be most appreciated.

like image 499
Wally Walrus Avatar asked Apr 20 '16 05:04

Wally Walrus


3 Answers

  1. Close all instances of Visual Studio
  2. Delete everything in this folder C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
  3. Restart Visual Studio
  4. Reload Project in Visual Studio
like image 73
likui Avatar answered Oct 15 '22 10:10

likui


Check the C:\Users\%username%\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml

I my case there was an entry like

  <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>

After checking for the 'insights' word in the search bar under the 'Tools -> Extensions and Updates' among the 'Installed' plugins, it showed me the plugin 'Developer Analytics Tools'. Removed this plugin and the problem went away.

like image 32
Rostfrei Avatar answered Oct 15 '22 11:10

Rostfrei


I had similar issue with a third party package.

After following their online steps about deleting from '\Common7\IDE\Extensions' I still received the error.

They told me as a final step to open a vs command prompt and run:

devenv /UpdateConfiguration

And the error has gone away.

like image 8
Mike Cheel Avatar answered Oct 15 '22 11:10

Mike Cheel