10

I keep my code in git, integrated through the built in git tools in visual studio 2015. I'm running Windows 10.

Recently, my Team Explorer windows (usually showing my uncommitted changes or whatever) started showing this:

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)

or several similar errors depending on which page I go to, like:

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)

I went check under setting (Tools-->Options--> Source control) and see that the Current source control plugin (which used to be set to git) is now "None". I click the dropdown and change it back to git... and it changes right back to None.

I've also started getting an error message that appears on VS launch (Unable to load SccProviderPackage) (same error as here)

But I don't know how to pursue that avenue.

Here is some relevant lines from the VS log file:

109 ERROR SetSite failed for package [SccProviderPackage] 
110 ERROR End package load [SccProviderPackage] 
...
683 Warning Unexpected system error mode before loading package [GitCollaborationPackage] 

Troubleshooting I've done:

  1. Run a repair in Visual Studio.
  2. Changed the installation so that all optional items are installed
  3. Checked the system event log... nothing.
  4. Cleared the Visual Studio Component Model Cache
  5. Removed the GitHub Extension
  6. Completely Uninstalled Visual Studio (and all the other things like SQL tools and the program files dir) and re-installed
  7. Launched in safe mode
  8. Ran devenv /setup

I can use command line git to do stuff, I just liked the integrated stuff in VS. Any ideas what went wrong (troubleshoot) or how to fix it?

Community
  • 1
  • 1
Aaron
  • 1,390
  • 1
  • 16
  • 30
  • 1
    Try updating the GitHub extension. There were issues with that causing issues. – jessehouwing Aug 17 '15 at 16:40
  • The update manager doesn't show any available upgrades: I have version 1.0.12.1 of the GitHub Extension, also uninstalling it didn't help – Aaron Aug 17 '15 at 16:41
  • Also fully uninstalling VS (including all those things in add/remove programs, and dleteing the folder) and re-installing didn't work – Aaron Aug 17 '15 at 19:03
  • 1
    Does it work on a clean git repository? – jessehouwing Aug 17 '15 at 19:05
  • 1
    And have you tried clearing the ComponentModel Cache? http://stackoverflow.com/a/17604007/736079 – jessehouwing Aug 17 '15 at 19:06
  • @jessehouwing it doesn't work even without loading a git repo, just a empty project. Also I have tried deleting that folder, error still occurs – Aaron Aug 17 '15 at 19:31
  • 1
    Tried starting Visual Studio in safe mode? Tried deleting your Visual Studio extensions? – jessehouwing Aug 18 '15 at 09:09
  • @jessehouwing did not help, updated question – Aaron Aug 18 '15 at 12:45
  • Try removing the extension then downloading it from here - https://visualstudiogallery.msdn.microsoft.com/75be44fb-0794-4391-8865-c3279527e97d - the one that was bundled with the beta was borked at some point even though it had the same version number. – Lasse V. Karlsen Aug 18 '15 at 12:47
  • @LasseV.Karlsen I have completely removed the github extension (if that is the one your talking about) – Aaron Aug 18 '15 at 12:52

1 Answers1

11

So in this case running devenv /resetuserdata from an administrator VS command prompt fixed my problems... not sure why or what went wrong, just after running this command source control started to work. No more error messages

Shout out to http://tech.trailmax.info/2014/01/vs-package-did-not-load-correctly/ and to jessehouwing for helping debug

Aaron
  • 1,390
  • 1
  • 16
  • 30
  • 2
    I tried the above, but finally found the resolution in the ActivityLog.xml file. Turn out I had copied the (GIT) source code from another folder and it could not find the bindings, even though I was not opening the solution. Renaming the folder allowed me to get rid of the error message and choose Git as my source control. – Shailen Sukul Oct 17 '15 at 03:49
  • I ran visual studio as administrator, which fixed my issue. – Praveen Patel G May 24 '21 at 05:26
  • 1
    Again i faced the same issue with another project. But this time, it is fixed by Pushing first and then pulling the branch..!! If you try only pull, it won't work..!! – Praveen Patel G May 28 '21 at 04:39