New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work in Blend despite showing as an extension for it #951

Closed
Clef-0 opened this Issue Apr 5, 2017 · 9 comments

Comments

Projects
None yet
6 participants
@Clef-0

Clef-0 commented Apr 5, 2017

The GitHub plugin shows in Microsoft Blend 2017's extensions browser but spews an error in the sidebar when it is loaded.

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()
@paladique

This comment has been minimized.

Show comment
Hide comment
@paladique

paladique Apr 22, 2017

Collaborator

Hi @Clef-0, thanks for bringing this to our attention. I'm also seeing the same thing when I open Blend 2017. We'll take a look into this.

In the meantime, if you disable the extension (Disable button on the extension in Extensions and Updates) and restart Blend, that error will disappear. This will not disable the extension in Visual Studio if you use it as well.

Collaborator

paladique commented Apr 22, 2017

Hi @Clef-0, thanks for bringing this to our attention. I'm also seeing the same thing when I open Blend 2017. We'll take a look into this.

In the meantime, if you disable the extension (Disable button on the extension in Extensions and Updates) and restart Blend, that error will disappear. This will not disable the extension in Visual Studio if you use it as well.

@paladique

This comment has been minimized.

Show comment
Hide comment
@paladique

paladique Apr 24, 2017

Collaborator

@AArnott Is it possible to configure a vsix file to not install on Blend until we can figure out how/if we can support Blend?

Collaborator

paladique commented Apr 24, 2017

@AArnott Is it possible to configure a vsix file to not install on Blend until we can figure out how/if we can support Blend?

@AArnott

This comment has been minimized.

Show comment
Hide comment
@AArnott

AArnott Apr 24, 2017

Collaborator

I believe Blend won't load VS packages unless they are on a whitelist. If your GitHub extension defines a VS Package (I'm pretty sure it does), then it probably isn't loading in Blend, so you get a null back from GetService or perhaps LoadPackage calls you make. You should always check for null results from these calls anyway. If you get null back, you can hopefully gracefully degrade or simply deactivate to avoid an exception like this.

I'm pretty sure that there isn't a way for a VSIX to not apply to Blend. So while Packages are automatically disabled in Blend for you, the MEF extension is not. So your MEF extension should no-op if it needs a VS package that can't produce its service. Is that something you can do on your end?

Collaborator

AArnott commented Apr 24, 2017

I believe Blend won't load VS packages unless they are on a whitelist. If your GitHub extension defines a VS Package (I'm pretty sure it does), then it probably isn't loading in Blend, so you get a null back from GetService or perhaps LoadPackage calls you make. You should always check for null results from these calls anyway. If you get null back, you can hopefully gracefully degrade or simply deactivate to avoid an exception like this.

I'm pretty sure that there isn't a way for a VSIX to not apply to Blend. So while Packages are automatically disabled in Blend for you, the MEF extension is not. So your MEF extension should no-op if it needs a VS package that can't produce its service. Is that something you can do on your end?

@shana

This comment has been minimized.

Show comment
Hide comment
@shana

shana Apr 24, 2017

Collaborator

@AArnott Thanks for the info! Yup, we can degrade gracefully, and we can probably bypass the package entirely for Blend and make it work - the TE functionality doesn't depend on it directly, it's there to support the Start Page Clone and some other things here and there.

Collaborator

shana commented Apr 24, 2017

@AArnott Thanks for the info! Yup, we can degrade gracefully, and we can probably bypass the package entirely for Blend and make it work - the TE functionality doesn't depend on it directly, it's there to support the Start Page Clone and some other things here and there.

@paladique paladique added bug and removed needs investigation labels Apr 24, 2017

@jcansdale

This comment has been minimized.

Show comment
Hide comment
@jcansdale

jcansdale Apr 27, 2017

Contributor

I've tried to repro this. After installing the GitHub extension from the marketplace, I see:
image

The extension never actually shows up (even after a reboot). I tried this with Visual Studio 2017 Enterprise and Community. 😕

Contributor

jcansdale commented Apr 27, 2017

I've tried to repro this. After installing the GitHub extension from the marketplace, I see:
image

The extension never actually shows up (even after a reboot). I tried this with Visual Studio 2017 Enterprise and Community. 😕

@SpeedHighway

This comment has been minimized.

Show comment
Hide comment
@SpeedHighway

SpeedHighway Jun 28, 2017

This is affecting me on 2015, as well. It doesn't look like there's been a recent extension update, but a windows update, from last week, may have caused it. I can no longer even open my solution that I'm using that has a VSTS git repository in it, because the simple act of it having git causes Blend to crash when I open the solution and I get the above error in the team explorer if I try to simply look there without a solution. I'll have to remove the extension from Visual Studio, and hope that it resolves the issue in Blend, for now, until this gets a fix.

This is affecting me on 2015, as well. It doesn't look like there's been a recent extension update, but a windows update, from last week, may have caused it. I can no longer even open my solution that I'm using that has a VSTS git repository in it, because the simple act of it having git causes Blend to crash when I open the solution and I get the above error in the team explorer if I try to simply look there without a solution. I'll have to remove the extension from Visual Studio, and hope that it resolves the issue in Blend, for now, until this gets a fix.

@jcansdale

This comment has been minimized.

Show comment
Hide comment
@jcansdale

jcansdale Jul 6, 2017

Contributor

I've just loaded Blend 2015 and got a crash.

image

It looks like the GitHub for VS assemblies are being loaded.

image

I'll report back when I know more.

Contributor

jcansdale commented Jul 6, 2017

I've just loaded Blend 2015 and got a crash.

image

It looks like the GitHub for VS assemblies are being loaded.

image

I'll report back when I know more.

@jcansdale

This comment has been minimized.

Show comment
Hide comment
@jcansdale

jcansdale Jul 7, 2017

Contributor

Lots of exceptions like this one are showing up in Team Explorer.

image

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()
Contributor

jcansdale commented Jul 7, 2017

Lots of exceptions like this one are showing up in Team Explorer.

image

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()
@jcansdale

This comment has been minimized.

Show comment
Hide comment
@jcansdale

jcansdale Jul 11, 2017

Contributor

@Clef-0,

Thanks for reporting this. It is indeed a nasty issue! A fix will be included in the next release.

We now have a PR (#1055) that stops Blend from crashing or showing this error. If it's bothering you, we could make a preview version available for you to try.

Contributor

jcansdale commented Jul 11, 2017

@Clef-0,

Thanks for reporting this. It is indeed a nasty issue! A fix will be included in the next release.

We now have a PR (#1055) that stops Blend from crashing or showing this error. If it's bothering you, we could make a preview version available for you to try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment