The 'CascadePackage' package did not load correctly

Visual Studio-2019

Visual Studio-2019 Problem Overview


I just did an update to VS2019(16.9.0) and now I get this message. (actually on two machines). A restart does not resolve the problem.

What is the CascadePackage? Can I just say No to dialogue box and be OK?

Also...the file it mentions to examine...does not exist anymore, nore the directory it was in. enter image description here

I did find this line in the latest ActivityLog.xml

  <entry>
    <record>894</record>
    <time>2021/03/05 13:52:21.259</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [CascadePackage]Source: &apos;System.ComponentModel.Composition&apos; Description: The composition produced multiple composition errors, with 3 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.&#x000D;&#x000A;&#x000D;&#x000A;1) No exports were found that match the constraint: &#x000A;&#x0009;ContractName&#x0009;Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler&#x000A;&#x0009;RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot set import &apos;Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName=&quot;Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler&quot;)&apos; on part &apos;Microsoft.VisualStudio.Cascade.CascadePackage&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName=&quot;Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler&quot;) --&gt;  Microsoft.VisualStudio.Cascade.CascadePackage&#x000D;&#x000A;&#x000D;&#x000A;2) No exports were found that match the constraint: &#x000A;&#x0009;ContractName&#x0009;Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler&#x000A;&#x0009;RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot set import &apos;Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName=&quot;Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler&quot;)&apos; on part &apos;Microsoft.VisualStudio.Cascade.CascadePackage&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName=&quot;Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler&quot;) --&gt;  Microsoft.VisualStudio.Cascade.CascadePackage&#x000D;&#x000A;&#x000D;&#x000A;3) No exports were found that match the constraint: &#x000A;&#x0009;ContractName&#x0009;Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService&#x000A;&#x0009;RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot set import &apos;Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName=&quot;Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService&quot;)&apos; on part &apos;Microsoft.VisualStudio.Cascade.CascadePackage&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName=&quot;Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService&quot;) --&gt;  Microsoft.VisualStudio.Cascade.CascadePackage&#x000D;&#x000A;&#x000D;&#x000A;</description>
    <guid>{D86E17D6-7FC7-47F4-9259-21748EDFF93B}</guid>
    <hr>80131500</hr>
    <errorinfo></errorinfo>
  </entry>

Visual Studio-2019 Solutions


Solution 1 - Visual Studio-2019

Seem like this was caused by LiveShare. From Visual Studio Developer Community

Just search for

> The 'CascadePackage' package did not load correctly

As for my two issues:

> On one machine...the error went away by starting VisualStudio. > > On another machine I went into Tools->Get Tools and Features...
> Click on Individual components search for Live Share. Uncheck it. > Restart VS.
> > Go back into Tools->Get Tools and Features...
Click on > Individual components search for Live Share. Check it back.

More about the ActivityLog...
Visual Studio uses a /log option on update. This creates the ActivityLog.xml.
More here /Log (devenv.exe) This is something you can also do yourself.

The description part of the ActivityLog.xml will list where the problems are. Here is an edited breakdown of the original message in the OP.

<entry>
    <record>894</record>
    <time>2021/03/05 13:52:21.259</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [CascadePackage]Source: &apos;System.ComponentModel.Composition&apos; 
	Description: The composition produced multiple composition errors, with 3 root causes. 
	The root causes are provided below. 
	Review the CompositionException.Errors property for more detailed information.&#x000D;&#x000A;&#x000D;&#x000A;
	1) No exports were found that match the constraint: &#x000A;&#x0009;
	ContractName&#x0009;Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler&#x000A;&#x0009;
	RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler&#x000D;&#x000A;&#x000D;&#x000A;
	Resulting in: Cannot set import &apos;
	Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName=&quot;
	Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler&quot;)&apos; on part &apos;
	Microsoft.VisualStudio.Cascade.CascadePackage&apos;.&#x000D;&#x000A;
	Element: Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName=&quot;
	Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler&quot;) --&gt;  
	Microsoft.VisualStudio.Cascade.CascadePackage&#x000D;&#x000A;&#x000D;&#x000A;
	2) No exports were found that match the constraint: &#x000A;&#x0009;
	ContractName&#x0009;Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler&#x000A;&#x0009;
	RequiredTypeIdentity&#x0009;
	Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler&#x000D;&#x000A;&#x000D;&#x000A;
	Resulting in: Cannot set import &apos;
	Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName=&quot;
	Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler&quot;)&apos; on part &apos;
	Microsoft.VisualStudio.Cascade.CascadePackage&apos;.&#x000D;&#x000A;
	Element: Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName=&quot;
	Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler&quot;) --&gt;  
	Microsoft.VisualStudio.Cascade.CascadePackage&#x000D;&#x000A;&#x000D;&#x000A;
	3) No exports were found that match the constraint: &#x000A;&#x0009;ContractName&#x0009;
	Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService&#x000A;&#x0009;RequiredTypeIdentity&#x0009;
	Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService&#x000D;&#x000A;&#x000D;&#x000A;
	Resulting in: Cannot set import &apos;
	Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName=&quot;
	Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService&quot;)&apos; on part &apos;
	Microsoft.VisualStudio.Cascade.CascadePackage&apos;.&#x000D;&#x000A;
	Element: Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName=&quot;
	Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService&quot;) --&gt;  
	Microsoft.VisualStudio.Cascade.CascadePackage&#x000D;&#x000A;&#x000D;&#x000A;
	</description>
    <guid>{D86E17D6-7FC7-47F4-9259-21748EDFF93B}</guid>
    <hr>80131500</hr>
    <errorinfo></errorinfo>
  </entry>

Solution 2 - Visual Studio-2019

To fix this error, please update to Visual Studio 16.9.2 - it has been fixed there. It's also mentioned in the Release Notes:

> Fixed an issue causing an error message indicating the CascadePackage did not load correctly

Solution 3 - Visual Studio-2019

I am on version 16.9.4 and still experiencing this issue. However I was able to get around it by either enabling or disabling the LiveShare extension (Extensions >> Manage Extensions >> Installed >> Live Share), and then recent VS.

If this doesn't work try reverting to the previous version, or updating it.

Sometimes I have to try the above a couple of times to get it working.

Solution 4 - Visual Studio-2019

Usually this error goes away on its own, after upgrading the Live Share extension and rebooting Visual Studio a couple of times (usually at least three times).

However, sometimes, that does not work. In these cases, cleaning the MEF cache as described manually (by deleting the content of %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache), or automating it via the extension Clear MEF Component Cache have solved the problem.

Clearly, if you do not wish to use Live Share, you could just disable it from the Extensions menu and the package will not even be loaded by Visual Studio.

Update: I noticed that the issue sometimes occurs even with Live Share disabled. In all my (many) attempts, toggling it resolved the startup issue after clearing the MEF cache.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionChris CatignaniView Question on Stackoverflow
Solution 1 - Visual Studio-2019Chris CatignaniView Answer on Stackoverflow
Solution 2 - Visual Studio-2019OliverView Answer on Stackoverflow
Solution 3 - Visual Studio-2019deedubelluView Answer on Stackoverflow
Solution 4 - Visual Studio-2019YenneferView Answer on Stackoverflow