【发布时间】:2023-03-10 04:20:01
【问题描述】:
我将代码保存在 git 中,通过 Visual Studio 2015 中的内置 git 工具进行集成。我运行的是 Windows 10。
最近,我的团队资源管理器窗口(通常显示我未提交的更改或其他)开始显示:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.TeamFoundation.Git.Provider.ServiceProviderExtensionMethods.EnsurePackageLoaded(IServiceProvider serviceProvider, Guid packageGuid)
at Microsoft.TeamFoundation.Git.Provider.ServiceProviderExtensionMethods.EnsureSccAndTfPackagesLoaded(IServiceProvider serviceProvider)
at Microsoft.TeamFoundation.Git.Provider.Settings.SettingsLinksSectionVS.Initialize(Object sender, SectionInitializeEventArgs e)
at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.Framework.TeamExplorerSectionHost.Initialize(Object context)
或几个类似的错误取决于我去哪个页面,例如:
System.Exception: Exception of type 'System.Exception' was thrown.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
at Microsoft.TeamFoundation.Git.Provider.ServiceProviderExtensionMethods.EnsurePackageLoaded(IServiceProvider serviceProvider, Guid packageGuid)
at Microsoft.TeamFoundation.Git.Provider.ServiceProviderExtensionMethods.EnsureSccAndTfPackagesLoaded(IServiceProvider serviceProvider)
at Microsoft.TeamFoundation.Git.Provider.Repositories.GitTeamProjectExtendedInfoProvider.set_ServiceProvider(IServiceProvider value)
at Microsoft.VisualStudio.TeamFoundation.TeamExplorer.ConnectPage.ConnectPageVS.Initialize(Object sender, PageInitializeEventArgs e)
at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.Framework.TeamExplorerPageHost.Initialize(TeamExplorerPageContext context)
我检查了设置(工具-->选项-->源代码控制),发现当前源代码控制插件(以前设置为 git)现在是“无”。我单击下拉菜单并将其更改回 git... 并立即更改回 None。
我也开始收到 VS 启动时出现的错误消息(无法加载 SccProviderPackage)(与 here 相同的错误)
但我不知道如何追求这条道路。
以下是 VS 日志文件中的一些相关行:
109 ERROR SetSite failed for package [SccProviderPackage]
110 ERROR End package load [SccProviderPackage]
...
683 Warning Unexpected system error mode before loading package [GitCollaborationPackage]
我已完成的故障排除:
- 在 Visual Studio 中运行修复。
- 更改了安装,以便安装所有可选项目
- 检查了系统事件日志...没有。
- 清除了Visual Studio Component Model Cache
- 删除了 GitHub 扩展
- 完全卸载 Visual Studio(以及所有其他东西,如 SQL 工具和程序文件目录)并重新安装
- 以安全模式启动
- 运行 devenv /setup
我可以使用命令行 git 来做一些事情,我只是喜欢 VS 中集成的东西。任何想法出了什么问题(故障排除)或如何解决?
【问题讨论】:
-
尝试更新 GitHub 扩展。存在导致问题的问题。
-
更新管理器没有显示任何可用的升级:我有 GitHub 扩展的 1.0.12.1 版本,卸载它也没有帮助
-
它可以在干净的 git 存储库上工作吗?
-
您是否尝试过清除 ComponentModel 缓存? stackoverflow.com/a/17604007/736079
-
尝试在安全模式下启动 Visual Studio?尝试删除您的 Visual Studio 扩展?
标签: git visual-studio visual-studio-2015