我把我的代码放在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...然后它又立即变回了“无”。
启动VS时,我还开始收到一个错误消息(无法加载SccProviderPackage)(与这里相同的错误)
但我不知道如何继续追寻这个问题。
以下是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组件模型缓存
- 移除GitHub扩展程序
- 完全卸载Visual Studio(以及所有其他工具如SQL工具和程序文件目录)并重新安装
- 在安全模式下启动
- 运行devenv /setup
我可以使用命令行git完成任务,但我更喜欢VS中的集成功能。你有什么想法是哪里出了问题(进行故障排除)或如何修复它吗?