VS.DiffAllFiles icon indicating copy to clipboard operation
VS.DiffAllFiles copied to clipboard

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

Open TheEqualizer opened this issue 7 years ago • 8 comments

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

TheEqualizer avatar Apr 09 '19 10:04 TheEqualizer

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 .

deadlydog avatar Apr 09 '19 13:04 deadlydog

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.

StevenBonePgh avatar Apr 10 '19 10:04 StevenBonePgh

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

TheEqualizer avatar Apr 10 '19 11:04 TheEqualizer

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.

StevenBonePgh avatar Apr 10 '19 11:04 StevenBonePgh

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 avatar Apr 12 '19 06:04 deadlydog

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 avatar May 26 '19 20:05 deadlydog

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?

perahoky avatar Jun 04 '21 10:06 perahoky