Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

CompositionFailedException with "GitHub.Services.VSGitServices" on a fresh Re-install of VS2017 #1340

Closed
Nhallick opened this issue Nov 24, 2017 · 8 comments

Comments

@Nhallick
Copy link

  • GitHub Extension for Visual Studio version: 2.3.6.391
  • Visual Studio version: VS2017 v15.4.4

Uninstalled VS2017 yesterday due to some errors in an extension unrelated to GHfVS and this morning downloaded the latest version of VS community from the Microsoft site. VS2017 has installed fine with no errors and AFTER it was installed I went on to the extension marketplace and the first extension (other than the preloaded ones VS comes with) I downloaded/installed was the GHfVS extension.

Extension downloaded fine with no errors and I opened up VS to start customizing other things. As I opened up the Team Explorer panel to configure my GH account again on the connect screen there are a few errors regarding the GitHub.Services.VSGitServices part.

capture

Now I should also mention this isn't my only attempt at this today and I have attempted a few troubleshooting steps already (which I would be happy to repeat if need be). I've taken a look at issues #129, #987, #986 and a few others. I've gone through uninstalling the extension through the VS installer, deleting the .dll's and other files manually then running devenv /setup (at the correct time) then trying to install the extension again, and even went as far as just wiping all VS files and extensions and reinstalling but the error still persists. I've run out of troubleshooting that I can find and could really use some tips.

@Nhallick
Copy link
Author

Nhallick commented Nov 24, 2017

Heres the full error message since it was a little cut off in the picture above. Also probably worthy to mention this happens on every startup of VS and does not go away if I restart VS or my computer.


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.GetServiceT in C:\projects\visualstudio\src\GitHub.VisualStudio\Services\GitHubServiceProvider.cs:line 63
at GitHub.Services.VSGitServices..ctor(IGitHubServiceProvider serviceProvider) in C:\projects\visualstudio\src\GitHub.TeamFoundation.14\Services\VSGitServices.cs:line 45
--- 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.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func3 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.WhereSelectArrayIterator2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 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.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, Func3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 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.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.b__0()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass55_0.b__1()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass54_0.b__0()
at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_01.<As>b__0() at System.ComponentModel.Composition.ExportFactory1.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_02.<CreateStronglyTypedExportFactoryOfTM>b__0() at System.ComponentModel.Composition.ExportFactory1.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.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func3 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.WhereSelectArrayIterator2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 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.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_01.b__0()
at System.ComponentModel.Composition.ExportFactory1.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_02.b__0()
at System.ComponentModel.Composition.ExportFactory`1.CreateExport()
at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.Framework.TeamExplorerSectionHost.Create()

@grokys
Copy link
Contributor

grokys commented Nov 24, 2017

Hi @Nhallick, sorry about this.

This looks like a MEF error. Could you send us the contents of Visual Studio's MEF log? You can find this at %localappdata%\Microsoft\VisualStudio\15.0_60ffec9a\ComponentModelCache\Microsoft.VisualStudio.Default.err.

@Nhallick
Copy link
Author

Microsoft.VisualStudio.Default.zip

Here you go! Had to zip it because of the file type. That was one of my suspicions. I had tried to get a MEF cache clearer extension on the VS marketplace but it seems as if none of my extensions are working because of this 👎 😢

@grokys
Copy link
Contributor

grokys commented Nov 24, 2017

Hmm, that log is the same as the log on my machine: the errors in there are due to the way we dual-target VS2015 and 2017.

You say that no extensions are working? If you remove GitHub for Visual Studio (using the VS installer), can you then install the MEF cache clearer extension?

@Nhallick
Copy link
Author

As far as I can tell no other extensions are working as they should. The MEF cache clearer extension says it is installed but I do not see the entry in the "tools" menu for it as there should be. Additionally, other extensions I have downloaded that I know should have settings menus under the VS options screen do not show up.

For reference, this is the MEF cache clearer:
https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache

@grokys
Copy link
Contributor

grokys commented Nov 24, 2017

Yes, I use that extension myself - as you suggest it should add an entry to the Tools menu.

The fact that other extensions aren't working suggests that your VS installation is hosed in some way... I'm not sure what to suggest for that, I'm guessing that uninstalling and re-installing VS wasn't enough. At times like this I usually resort to a Windows re-install I'm afraid :( Another option might be MS support if you have that, but I suspect a Windows re-install would be quicker.

I'm going to close this issue because it doesn't appear to be an issue with our extension. If you do manage to fix the problem, please let us know what you did for future reference!

@Nhallick
Copy link
Author

Thanks for taking the time to help @grokys! I've submitted a report through VS2017 to see what the community/Microsoft can think of before I try anything too drastic like a windows re-install 😟. I will update this issue post with anything I can find out so hopefully, anyone facing this in the future will have an easier time than me!

@Nhallick
Copy link
Author

UPDATE - Issue seems to be fixed!


After scouring the internet for other similar issues I have seemed to stumble upon the solution. I found this link for a very similar problem to mine but with different extensions. I followed the same actions he took and deleted the privateregistry.bin file which I guess forces VS to run the first time setup again and clears some settings. When it was all loaded I was able to install all my extensions including GHfVS and as of writing this, they all work fine! I hope anyone else having this issue is able to find this and it fixes their issue 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants