我将我的代码保存在 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)现在是“无”。我单击下 pull 菜单并将其改回 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 工具和程序文件目录)并重新安装
- 以安全模式启动
- 运行开发/设置
我可以使用命令行 git 来做一些事情,我只是喜欢 VS 中集成的东西。有什么地方出了问题(故障排除)或如何解决的想法吗?
最佳答案
所以在这种情况下,从管理员 VS 命令提示符运行 devenv/resetuserdata
解决了我的问题...不知道为什么或出了什么问题,运行此命令后源代码控制开始工作。没有更多的错误信息
大声喊http://tech.trailmax.info/2014/01/vs-package-did-not-load-correctly/ 感谢 jessehouwing 帮助调试
关于git - Visual Studio 2015 git 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32055458/