Skip to content
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

Error trying to show the controls if they are loaded too shortly after Visual Studio is started [has workaround] #27

Open
TheEqualizer opened this issue Apr 9, 2019 · 7 comments
Assignees
Labels

Comments

@TheEqualizer
Copy link

Recently I only get this error where the controls should appear.. I have tried reinstalling but that hasn't helped.

Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "VS_DiffAllFiles.Sections.PendingChangesSection". ---> System.Windows.Markup.XamlParseException: Provide value on 'QuickConverter.MultiBinding' threw an exception. ---> System.Exception: Failed to tokenize expression "!$P0 || ($P0 ## $P1) ? Visibility.Visible : Visibility.Collapsed". Did you forget a '$'?
at QuickConverter.EquationTokenizer.Tokenize(String expression)
at QuickConverter.MultiBinding.GetLambda(String expression)
at QuickConverter.MultiBinding.ProvideValue(IServiceProvider serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
--- End of inner exception stack trace ---
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at VS_DiffAllFiles.Sections.DiffAllFilesSectionControl.InitializeComponent() in C:\dev\Git\VS.DiffAllFiles\VS.DiffAllFiles.VS2017\obj\Release\DiffAllFilesSectionControl.xaml:line 1
at VS_DiffAllFiles.DiffAllFilesBaseClasses.DiffAllFilesSectionBase..ctor() in C:\dev\Git\VS.DiffAllFiles\VS.DiffAllFiles\DiffAllFilesBaseClasses\DiffAllFilesSectionBase.cs:line 82
at VS_DiffAllFiles.Sections.PendingChangesSection..ctor() in C:\dev\Git\VS.DiffAllFiles\VS.DiffAllFiles\Sections\PendingChangesSection.cs:line 27
--- 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.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()

@deadlydog
Copy link
Owner

Hmmm, thanks for reporting this. Which version of Visual Studio are you using? And can you also confirm what version of the extension is installed please @TheEqualizer .

@StevenBonePgh
Copy link
Contributor

I'm seeing this as well in both VS2017 and VS2019 with Version 1.0.1. It did work flawlessly on VS2019 the first time after it was installed, subsequent opening of VS2019 instances all show the same error quoted above by the initial poster.

@TheEqualizer
Copy link
Author

I am using VS 2017 Community version 15.9.11 with extension version 1.1.0

@StevenBonePgh
Copy link
Contributor

After a bit of accidental messing around, I think I determined a pattern. If you have the Pending Changes window popped-out and visible when you close Visual Studio, it will fail as above when you reopen Visual Studio. If you have Pending Changes pinned but do not have it visible on exit (like in a tab group with pending changes in the non-active tab), and you wait a bit after VS launches then switch to the tab, it loads fine - switch too fast after launch and it will fail. Likely due to a side effect from the change you made for async loading.

@deadlydog
Copy link
Owner

Hey guys, I was able to replicate the issue thanks to your description @StevenBonePgh :) I believe the issue is fixed in VS 2019 v1.0.2 and VS 2017 v1.1.1.

I'm going to close this out, but if you still experience the issue please let me know! Thanks!

deadlydog added a commit that referenced this issue May 26, 2019
In VS 2019.1 synchronous extensions are disabled by default, so we are re-enabling async background loading on this extension, even though it will still cause issue #27.  See #32 for more details.
@deadlydog deadlydog changed the title Error when trying to show the controls Error when trying to show the controls if they appear too shortly after Visual Studio is started May 26, 2019
@deadlydog
Copy link
Owner

deadlydog commented May 26, 2019

I had to re-enable async background loading as part of fixing issue #32, so this will be a problem again.

Workaround

Until I get this issue fixed properly, it has a simple workaround of simply going back to the Home tab in the Team Explorer pane, and then back to the Changes/Pending Changes tab, as that will cause the control to reload, and should have given enough time for all of the other Visual Studio components to finish loading after startup.

Until the issue is fixed, I would recommend not having the Changes or Pending Changes windows popped out, otherwise they will always try to load as soon as Visual Studio starts and the error will occur.

@deadlydog deadlydog reopened this May 26, 2019
@deadlydog deadlydog changed the title Error when trying to show the controls if they appear too shortly after Visual Studio is started Error when trying to show the controls if they are loaded too shortly after Visual Studio is started May 26, 2019
@deadlydog deadlydog changed the title Error when trying to show the controls if they are loaded too shortly after Visual Studio is started Error trying to show the controls if they are loaded too shortly after Visual Studio is started [has workaround] May 26, 2019
@perahoky
Copy link

perahoky commented Jun 4, 2021

my visual studio does not (reliable) reload the pending changes tab after switching to team explorer/home and back. v16.9.6
extension fresh installed.
Error still showing. Pressing F5 did not help either.
Edit: now after some random clicking and trying it did.

Cann we access/attach to the reload event when pressing F5 in pending changes window? Then just reload control/whatever and go? could that work?

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

No branches or pull requests

4 participants