VS 17.13.6安装GitHub Copilot后Chat无法打开报错求助
解决方案:Visual Studio 17.13.6中Copilot Chat无法打开的异常问题
在Visual Studio 17.13.6版本中安装GitHub Copilot组件后,无法打开Copilot Chat,出现以下错误:
错误摘要:
An exception was encountered while constructing the content of this frame. This information is also logged in "C:\Users\{{YOUR_USER_NAME}}\AppData\Roaming\Microsoft\VisualStudio\17.0_f9957bae\ActivityLog.xml".
异常详情:
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "Microsoft.VisualStudio.Copilot.UI.ChatMefPartAccessor" but found 0 after applying applicable constraints. at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition) at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView](String contractName, ImportCardinality cardinality) at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName) at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]() at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]() at Microsoft.VisualStudio.Conversations.UI.Internal.ChatWindow.ChatHelpWindow.CreationContext.<CreateInstanceAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Conversations.UI.Internal.ConversationsUIPackage.<InitializeToolWindowAsync>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass19_0.<<Microsoft-VisualStudio-Shell-Interop-IVsAsyncToolWindowFactory-InitializeToolWindowAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck) at Microsoft.VisualStudio.Shell.VsTaskLibraryHelper.<>c__DisplayClass54_0.<<CancelWhenCancellationRequested>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck) at Microsoft.VisualStudio.Shell.VsTaskLibraryHelper.<>c__DisplayClass54_0.<<CancelWhenCancellationRequested>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck) at Microsoft.VisualStudio.Shell.AsyncPackage.<CompleteToolWindowCreationAsync>d__24.MoveNext()
可行解决方案
重置Visual Studio用户数据缓存
- 关闭所有Visual Studio实例
- 打开命令提示符(建议以管理员身份运行),执行命令:
devenv /resetuserdata - 重启Visual Studio,重新登录GitHub Copilot账号
修复/重新安装GitHub Copilot组件
- 打开Visual Studio,依次点击「扩展」>「管理扩展」
- 在「已安装」标签页找到GitHub Copilot,点击「卸载」
- 卸载完成后重启Visual Studio,通过扩展市场或Visual Studio安装程序重新安装Copilot组件
- 若使用安装程序,选择「修改」选项,确保Copilot相关组件已勾选后完成安装
清理MEF组件缓存
- 关闭Visual Studio
- 导航到路径:
C:\Users\<你的用户名>\AppData\Local\Microsoft\VisualStudio\17.0_<随机标识>\ComponentModelCache - 删除该文件夹下的所有文件
- 重启Visual Studio
升级Visual Studio到最新版本
打开Visual Studio安装程序,检查并安装最新的17.x版本更新,旧版本的兼容性问题通常会在新版本中得到修复
内容的提问来源于stack exchange,提问作者Viswa
相关产品推荐
相关产品推荐

