github / VisualStudio

GitHub Extension for Visual Studio
https://visualstudio.github.com
MIT License
2.38k stars 1.2k forks source link

CompositionFailedException when opening Team Explorer window #986

Open AlexEyler opened 7 years ago

AlexEyler commented 7 years ago

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.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
paulomorgado commented 7 years ago

Same issue as #987

paladique commented 7 years ago

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?

paladique commented 7 years ago

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 support@github.com if you'd prefer not to share those logs in this issue.

shana commented 7 years ago

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?

AlexEyler commented 7 years ago

@shana Looks like there've been 43 hits on 15.0.26430.4 (15.2).

paulomorgado commented 7 years ago

Justa sent an e-mail to support@github.com mentioning issues 986 and 987. Please, acknowledge.

grokys commented 7 years ago

Thanks @paulomorgado, we received your email and passed it on to MS.

grokys commented 6 years ago

@AlexEyler is this still an issue?

nemeth-tibor commented 6 years ago

It happens on VS2015 also and that is not a "fresh install".

dibley1973 commented 6 years ago

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:

  1. Shut down all instances of VS2015
  2. Uninstall the extension using VS2015 developer command prompt vsixinstaller /uninstall:c3d3dc68-c977-411f-b3e8-03b0dccf7dfc
  3. Use "Agent Ransack" (or another search tool) to find all folders with GitHub.VisualStudio.dll file in the extensions folder of the VS2015 installation.
  4. Delete those folders found by "Agent Ransack"
  5. Download the extension from the marketplace
  6. Reinstall the extension
  7. Restart VS2015 and hey presto issue is resolved.

I hope that may help others who experience this issue.

supermamon commented 6 years ago

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.

chungnyul commented 4 years ago

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.

  1. Select uninstall this github extension in visual studio's 'manage extensions' - 'installed' menu.
  2. Exit visual studio for uninstall process.
  3. Start visual sutdio. Select Install github extension in visual studio's 'manage extensions' - 'online' menu.
  4. Exit visual studio for install process.
  5. I got solved. ^^;;