我刚刚对 VS2019(16.9.0) 进行了更新,现在我收到了这条消息。 (实际上在两台机器上)。重新启动并不能解决问题。
什么是 CascadePackage? 我可以对对话框说No就OK了吗?
另外...它提到要检查的文件...不再存在,也不存在它所在的目录。
我确实在最新的 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: 'System.ComponentModel.Composition' 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.

1) No exports were found that match the constraint: 
	ContractName	Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
	RequiredTypeIdentity	Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler

Resulting in: Cannot set import 'Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler")' on part 'Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler") --> Microsoft.VisualStudio.Cascade.CascadePackage

2) No exports were found that match the constraint: 
	ContractName	Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
	RequiredTypeIdentity	Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler

Resulting in: Cannot set import 'Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler")' on part 'Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler") --> Microsoft.VisualStudio.Cascade.CascadePackage

3) No exports were found that match the constraint: 
	ContractName	Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
	RequiredTypeIdentity	Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService

Resulting in: Cannot set import 'Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService")' on part 'Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService") --> Microsoft.VisualStudio.Cascade.CascadePackage

</description>
<guid>{D86E17D6-7FC7-47F4-9259-21748EDFF93B}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
答案 0 :(得分:61)
这似乎是由 LiveShare 引起的。 来自Visual Studio Developer Community
只需搜索
<块引用>'CascadePackage' 包没有正确加载
至于我的两个问题:
<块引用>在一台机器上……启动 VisualStudio 后错误消失了。
在另一台机器上,我进入了工具->获取工具和功能...
单击 Individual components
搜索 Live Share。取消选中它。
重新启动 VS。
返回到工具->获取工具和功能...
点击
Individual components
搜索 Live Share。回来看看。
有关 ActivityLog 的更多信息...
Visual Studio 在更新时使用 /log
选项。这将创建 ActivityLog.xml。
详情请点击此处/Log (devenv.exe)您也可以自己做这些事情。
ActivityLog.xml 的描述部分将列出问题所在。这是 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: 'System.ComponentModel.Composition'
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.


1) No exports were found that match the constraint: 
	
ContractName	Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
	
RequiredTypeIdentity	Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler


Resulting in: Cannot set import '
Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler")' on part '
Microsoft.VisualStudio.Cascade.CascadePackage'.

Element: Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler") -->
Microsoft.VisualStudio.Cascade.CascadePackage


2) No exports were found that match the constraint: 
	
ContractName	Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
	
RequiredTypeIdentity	
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler


Resulting in: Cannot set import '
Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler")' on part '
Microsoft.VisualStudio.Cascade.CascadePackage'.

Element: Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler") -->
Microsoft.VisualStudio.Cascade.CascadePackage


3) No exports were found that match the constraint: 
	ContractName	
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
	RequiredTypeIdentity	
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService


Resulting in: Cannot set import '
Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService")' on part '
Microsoft.VisualStudio.Cascade.CascadePackage'.

Element: Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService") -->
Microsoft.VisualStudio.Cascade.CascadePackage


</description>
<guid>{D86E17D6-7FC7-47F4-9259-21748EDFF93B}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
答案 1 :(得分:2)
要修复此错误,请更新到 Visual Studio 16.9.2 - 它已在那里修复。 Release Notes 中也提到了这一点:
<块引用>修复了导致错误消息指示 CascadePackage 未正确加载的问题
答案 2 :(得分:0)
我使用的是 16.9.4 版本,但仍然遇到此问题。但是,我可以通过启用或禁用 LiveShare 扩展(扩展 >> 管理扩展 >> 已安装 >> 实时共享)和最近的 VS 来绕过它。
如果这不起作用,请尝试恢复到以前的版本或更新它。
有时我必须多次尝试上述方法才能使其正常工作。