My vs package did not load correctly
Asked Answered
W

5

22

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.

Wunderlich answered 20/4, 2016 at 5:16 Comment(2)
The VSIX project was referencing the wrong secondary library (built for debug - not the one built for release). Problem solved - thanks for reading.Wunderlich
See Also: How can I fix the Microsoft Visual Studio error: "package did not load correctly"?Butterball
L
35
  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
Laevogyrate answered 4/8, 2016 at 11:8 Comment(3)
No, it doesn't help. Absolutely nothing changes.Numismatist
Prefect! Worked for me very well.ThanksVitric
What a shock... answer on SO didn't help at all...Byran
W
13

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.

Whitherward answered 25/1, 2017 at 6:7 Comment(1)
I had this issue on a new Azure VM with VS2015 installed fresh. Removing this Developer Analytics Tools package stopped the error dialogue box appearing for me.Supersensual
S
8

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.

Strand answered 11/8, 2017 at 15:3 Comment(0)
K
1

Delete all files in the folder, (14.0 - VS2017) C:\Users\%username%\AppData\Local\Microsoft\VisualStudio\14.0

It 100% worked for me.

Khiva answered 11/3, 2019 at 15:2 Comment(1)
...or you could just MOVE the directory and not risk trashing an old install of VS that's kept there for compatibility reasons...Galvanoscope
S
0

I solved this issue upgrading Visual Studio (incompatibility problems). In order to do it just:

  • Launch Visual Studio Installer
  • Click on Update
Speedball answered 11/6, 2019 at 10:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.