An exception has been encountered. This may be caused by an extension.
You can get more information by examining the file 'C:\Users{user}\AppData\Roaming\Microsoft\VisualStudio\15.0_5de280e5\ActivityLog.xml'.
System.InvalidOperationException: Could not locate any instances of contract GitHub.Services.ITeamExplorerServiceHolder.
at GitHub.VisualStudio.GitHubServiceProvider.GetService(Type serviceType) in C:\projects\visualstudio\src\GitHub.VisualStudio\Services\GitHubServiceProvider.cs:line 147
at GitHub.VisualStudio.GitHubServiceProvider.GetServiceT in C:\projects\visualstudio\src\GitHub.VisualStudio\Services\GitHubServiceProvider.cs:line 153
at GitHub.VisualStudio.UI.GitHubPane.d__12.MoveNext() in C:\projects\visualstudio\src\GitHub.VisualStudio\UI\GitHubPane.cs:line 98
I have similar issue. Github Extension is the same but VS 2017 version 15.7.5
SetSite failed for package [GitHubPackage]Source: 'System.ComponentModel.Composition' Description: No exports were found that match the constraint: ContractName GitHub.Commands.IOpenFromUrlCommand RequiredTypeIdentity GitHub.Commands.IOpenFromUrlCommand
@PurTahan, @majorimi,
Could you try installing the following extension and clear the MEF component cache:
https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache
The MEF component cache: sometimes becomes corrupted and prevents extensions from loaded. This is usually random and nothing to do with the extension itself.
Please let us know if this fixes the issue.
@jcansdale , I tried it and nothing changed!
I had same issue with 15.7.5, same error in github tool window as @PurTahan even without project opened.
Solved it by removing github for desktop and github extension with VS installer and reinstalling them.
After that I've applied update to extension.
Today after 15.7.6 upgrade got same error, this time I've just reinstalled github extension and updated it after that.
BTW I tried "Revert" option for extension but thought it is not working because I didn't see that popup ended up in different monitor.
So instead reinstall you can try Revert from VS.
It would be nice if this could be fixed though.
Same problem here in 15.7.5 & 15.8-preview.5.
Disable the GitHub extension solved this.
Please fix this issues!
@PurTahan thanks fro the report. I have a PR with a possible workaround #1831.
Could you try installing this version (simply open the .vsix file):
https://ci.appveyor.com/api/buildjobs/9hh231frn2euc7be/artifacts/2.5.5.3553%2FGitHub.VisualStudio.vsix
Please let me know if this improves things.
@jcansdale I installed it and nothing changed
@milanc just to clarify, did uninstalling the extension and reinstalling then updating fix the problem for you?
This really seems to be something that's broken in Visual Studio itself. It looks like it's not loading the correct assemblies. If reinstalling and updating fixes the problem that would verify that theory.
@PurTahan do you by any chance have BitBucket for Visual Studio. I noticed in the log from someone experiencing a similar issue that they had it installed.
Could you install the ClearMEFComponentCache extension:
https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache
And run the Show MEF Errors command from the Tools menu:

If you could upload the log here, that would be very useful to compare. Thanks for your help testing this.
MEF Errors:
----- Catalog construction errors -----
Error #1
Microsoft.VisualStudio.Composition.PartDiscoveryException: Failure while scanning type "GitHub.VisualStudio.Base.TeamExplorerServiceHolder". ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Signature..ctor(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType)
at System.Reflection.RtFieldInfo.get_FieldType()
at Microsoft.VisualStudio.Composition.ReflectionHelpers.GetMemberType(MemberInfo fieldOrPropertyOrType)
at Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.AddImportsFromMembers(PropertyInfo[] declaredProperties, FieldInfo[] declaredFields, TypeRef partTypeRef, IList1 imports)
at Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.CreatePart(Type partType, Boolean typeExplicitlyRequested)
at Microsoft.VisualStudio.Composition.PartDiscovery.CombinedPartDiscovery.CreatePart(Type partType, Boolean typeExplicitlyRequested)
at Microsoft.VisualStudio.Composition.PartDiscovery.<>c__DisplayClass25_0.
--- End of inner exception stack trace ---
Error #2
Microsoft.VisualStudio.Composition.PartDiscoveryException: ReflectionTypeLoadException while enumerating types in assembly "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\GITHUB\GITHUB\GitHub.TeamFoundation.15.dll". Results will be incomplete. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Microsoft.VisualStudio.Composition.PartDiscovery.CombinedPartDiscovery.GetTypes(Assembly assembly)
at Microsoft.VisualStudio.Composition.PartDiscovery.<>c__DisplayClass26_0.
--- End of inner exception stack trace ---
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Threading, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Threading, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
----- CompositionError level 1 ------
GitHub.VisualStudio.TeamExplorer.Home.PulseNavigationItem.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Home.PulseNavigationItem
GitHub.VisualStudio.TeamExplorer.Connect.GitHubConnectSection1.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Connect.GitHubConnectSection1
GitHub.VisualStudio.TeamExplorer.Home.GraphsNavigationItem.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Home.GraphsNavigationItem
GitHub.VisualStudio.TeamExplorer.Home.PullRequestsNavigationItem.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Home.PullRequestsNavigationItem
GitHub.VisualStudio.TeamExplorer.Sync.GitHubPublishSection.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Sync.GitHubPublishSection
GitHub.VisualStudio.TeamExplorer.Connect.GitHubConnectSection0.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Connect.GitHubConnectSection0
GitHub.VisualStudio.TeamExplorer.Home.IssuesNavigationItem.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Home.IssuesNavigationItem
GitHub.VisualStudio.TeamExplorer.Home.WikiNavigationItem.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Home.WikiNavigationItem
GitHub.VisualStudio.TeamExplorer.Home.GitHubHomeSection.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Home.GitHubHomeSection
GitHub.VisualStudio.TeamExplorer.Home.ForkNavigationItem.ctor(holder): expected exactly 1 export of GitHub.Services.ITeamExplorerServiceHolder but found 0.
part definition GitHub.VisualStudio.TeamExplorer.Home.ForkNavigationItem
`
@PurTahan,
It looks like we're referencing an assembly that is only compatible with Visual Studio 2017 15.3 and later. Previously I don't think we were calling it, but we started to in this last release.
Could you try installing this version and see if that fixes it:
https://ci.appveyor.com/api/buildjobs/5qmel02q9qg4sqpv/artifacts/2.5.5.3604%2FGitHub.VisualStudio.vsix
I've change to using the Visual Studio 2017 15.0 assembly.
@jcansdale I was experiencing similar problems the past few days and your latest installer seems to have cleared up the problem on my machine.
@danielrouleau thanks for the report.
I was experiencing similar problems the past few days and your latest installer seems to have cleared up the problem on my machine.
Can I just make sure that I understand what you mean my my latest installer. Was it the link I posted immediately before your reply or the one a little further up? There are two changes and I want to make sure I know which one fixed it!
@jcansdale apologies, build 3604 was the one that resolved the issue.
@jcansdale thanks!
with this version, every things work correctly.
Hi @grokys ,
Yes, reinstalling it fixed problem the first time, after latest VS update applied I've had same error and reinstalling extension and updating fixed it again.
It is possible that positive outcome with new vsix is just same as reinstalling it and it might brake again after another vs update if this is related to VS as you suggested.
I had the same error and installing the .vsix for version 2.5.5.3604 fixed it. Thank you.
Most helpful comment
@PurTahan,
It looks like we're referencing an assembly that is only compatible with Visual Studio 2017 15.3 and later. Previously I don't think we were calling it, but we started to in this last release.
Could you try installing this version and see if that fixes it:
https://ci.appveyor.com/api/buildjobs/5qmel02q9qg4sqpv/artifacts/2.5.5.3604%2FGitHub.VisualStudio.vsix
I've change to using the Visual Studio 2017 15.0 assembly.