Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 git erroring out

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?

like image 232
Aaron Avatar asked Aug 17 '15 16:08

Aaron


People also ask

How do I checkout Git in Visual Studio?

In the Visual Studio IDE, select the Git menu, and then select Clone Repository. Follow the prompts to connect to the Git repository that includes the files you're looking for.

How do I get the Git menu in Visual Studio?

Can you see "Add to Source Control" in lower right corner of Visual Studio window? If yes, click it and then click Git. In my case, Git menu appeared after this action.


1 Answers

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

like image 56
Aaron Avatar answered Oct 13 '22 03:10

Aaron