__What happened__ (with steps, logs and screenshots, if possible)
It appears that on some machines with 15.2 installed, users are seeing a CompositionFailedException from GitHub when opening the team explorer window. I've seen the same being reported in telemetry from the 15.2 release.
The callstack is:
Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "GitHub.Services.VSGitServices". ---> System.NullReferenceException: Object reference not set to an instance of an object.
at GitHub.VisualStudio.GitHubProviderDispatcher.GetService[T]() in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.VisualStudio\Services\GitHubServiceProvider.cs:line 63
at GitHub.Services.VSGitServices..ctor(IGitHubServiceProvider serviceProvider) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeep\src\GitHub.TeamFoundation.14\Services\VSGitServices.cs:line 40
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass55_0.<CreateExportFactoryExport>b__1()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass54_0.<CreateExportFactory>b__0()
at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_0`1.<As>b__0()
at System.ComponentModel.Composition.ExportFactory`1.CreateExport()
at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.ComposablePartDefinitionForExportFactory.CreatePart()
at System.ComponentModel.Composition.ReflectionModel.ExportFactoryCreator.LifetimeContext.GetExportLifetimeContextFromExport[T](Export export)
at System.ComponentModel.Composition.ReflectionModel.ExportFactoryCreator.<>c__DisplayClass6_0`2.<CreateStronglyTypedExportFactoryOfTM>b__0()
at System.ComponentModel.Composition.ExportFactory`1.CreateExport()
at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.Framework.TeamExplorerSectionHost.Create()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass55_0.<CreateExportFactoryExport>b__1()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass54_0.<CreateExportFactory>b__0()
at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_0`1.<As>b__0()
at System.ComponentModel.Composition.ExportFactory`1.CreateExport()
at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.ComposablePartDefinitionForExportFactory.CreatePart()
at System.ComponentModel.Composition.ReflectionModel.ExportFactoryCreator.LifetimeContext.GetExportLifetimeContextFromExport[T](Export export)
at System.ComponentModel.Composition.ReflectionModel.ExportFactoryCreator.<>c__DisplayClass6_0`2.<CreateStronglyTypedExportFactoryOfTM>b__0()
at System.ComponentModel.Composition.ExportFactory`1.CreateExport()
at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.Framework.TeamExplorerSectionHost.Create()
```
The inner exception is the most interesting part:
System.NullReferenceException: Object reference not set to an instance of an object.
at GitHub.VisualStudio.GitHubProviderDispatcher.GetServiceT in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeepsrc\GitHub.VisualStudio\Services\GitHubServiceProvider.cs:line 63
at GitHub.Services.VSGitServices..ctor(IGitHubServiceProvider serviceProvider) in Y:\jenkins\workspace\GitHub for Visual Studio speakeasy jenkinskeepsrc\GitHub.TeamFoundation.14\Services\VSGitServices.cs:line 40
```
Same issue as #987
Hi @paulomorgado @AlexEyler, this is an known issue with VS2017 and initial install version of the extension failing when it is uploaded from the gallery (updating from 2.2.0.10 to 2.2.0.11). Did you install the extension during your initial install of VS2017?
In addition to above, if you have the time, some of the folks at Microsoft that we communicate with asked if you users could pass along some additional logs in regards to this. The tool to do this can be found here. Feel free to send a message to [email protected] if you'd prefer not to share those logs in this issue.
Microsoft is currently tracking a problem where updating the extension from the gallery fails if the extension was initially installed via the Visual Studio installer. @paulomorgado If you could run the tool @paladique linked to and share the logs with us, we'll pass them on to MS for analysis.
If this exception is indeed caused by a problem with the VS updater, then a workaround is to uninstall the extension first and then install it fresh from the gallery. Let us know if that works for you, that would be valuable information for us to know.
@AlexEyler Do you have some idea of how many users might be affected by this from your telemetry numbers?
@shana Looks like there've been 43 hits on 15.0.26430.4 (15.2).
Justa sent an e-mail to [email protected] mentioning issues 986 and 987. Please, acknowledge.
Thanks @paulomorgado, we received your email and passed it on to MS.
@AlexEyler is this still an issue?
It happens on VS2015 also and that is not a "fresh install".
Like @nemeth-tibor - I also experience this on VS2015, with version 14.0.25431.01 Update 3. The Github extensions version is 2.4.3.1737. It was installed from the VS Extensions dialog.
What worked for me was to use a combination of these two pages.
https://github.com/github/VisualStudio/issues/1394
https://github.com/github/VisualStudio/issues/987
In essence what I did to resolve was:
vsixinstaller /uninstall:c3d3dc68-c977-411f-b3e8-03b0dccf7dfcGitHub.VisualStudio.dll file in the extensions folder of the VS2015 installation.I hope that may help others who experience this issue.
I have VS 2015 v14.0.25431.01 Update 3.
Thanks @dibley1973 for those steps. In my case I got stuck at step 2 saying the VS2015 is using it even though it's already closed. I still proceeded the rest of the steps and it got resolved.
Thanks @dibley1973 for those step. But I processed a little differently.
I have VS 2017 community ver.15.9.13
I downloaded this extension from 'https://visualstudio.github.com/' and installed in my 2 pc (notebook and desktop).
Unfortunately, I had this same problem on my notebook and desktop.
But, I solved this problem, thanks @dibley1973 's step.
My step is below.
Most helpful comment
Like @nemeth-tibor - I also experience this on VS2015, with version 14.0.25431.01 Update 3. The Github extensions version is 2.4.3.1737. It was installed from the VS Extensions dialog.
What worked for me was to use a combination of these two pages.
https://github.com/github/VisualStudio/issues/1394
https://github.com/github/VisualStudio/issues/987
In essence what I did to resolve was:
vsixinstaller /uninstall:c3d3dc68-c977-411f-b3e8-03b0dccf7dfcGitHub.VisualStudio.dllfile in the extensions folder of the VS2015 installation.I hope that may help others who experience this issue.