【问题标题】:Visual Studio 2015 git erroring outVisual Studio 2015 git 出错
【发布时间】: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] 

我已完成的故障排除:

  1. 在 Visual Studio 中运行修复。
  2. 更改了安装,以便安装所有可选项目
  3. 检查了系统事件日志...没有。
  4. 清除了Visual Studio Component Model Cache
  5. 删除了 GitHub 扩展
  6. 完全卸载 Visual Studio(以及所有其他东西,如 SQL 工具和程序文件目录)并重新安装
  7. 以安全模式启动
  8. 运行 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


【解决方案1】:

所以在这种情况下,从管理员 VS 命令提示符运行 devenv /resetuserdata 解决了我的问题......不知道为什么或出了什么问题,就在运行这个命令源代码控制开始工作之后。没有更多错误消息

大声告诉http://tech.trailmax.info/2014/01/vs-package-did-not-load-correctly/ 并感谢 jessehouwing 帮助调试

【讨论】:

  • 我尝试了上面的,但最终在ActivityLog.xml文件中找到了分辨率。结果我从另一个文件夹复制了(GIT)源代码,即使我没有打开解决方案,它也找不到绑定。重命名文件夹让我摆脱了错误消息并选择 Git 作为我的源代码控制。
  • 我以管理员身份运行 Visual Studio,解决了我的问题。
  • 我再次在另一个项目中遇到了同样的问题。但是这一次,它是通过先推然后拉分支来固定的..!!如果你只尝试拉,它不会工作..!!
猜你喜欢
  • 1970-01-01
  • 2016-03-23
  • 2020-05-28
  • 2017-07-31
  • 2018-04-27
  • 1970-01-01
  • 1970-01-01
  • 2016-03-02
  • 1970-01-01
相关资源
最近更新 更多