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:
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?
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With