System.InvalidOperationException: The specified Visual is not a descendant of this Visual.

SyntaxEditor for WPF Forum

Posted 1 month ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 23.1.4
Platform: .NET 4.8
Environment: Windows 11 (64-bit)
Avatar

Hi,

we have received a crash report that occurs while the previous loaded documents are restored. It seems like the quick info is triggered when a C# document is loaded. I suppose by the time the popup is about to show, another document is already loaded.

There are two different call stacks, both with the same result:

System.InvalidOperationException: The specified Visual is not a descendant of this Visual.
   at System.Windows.Media.Visual.TrySimpleTransformToAncestor(Visual ancestor, Boolean inverse, GeneralTransform& generalTransform, Matrix& simpleTransform)
   at System.Windows.Media.Visual.TransformToDescendant(Visual descendant)
   at ActiproSoftware.Internal.u2R.OiY(Visual  , Visual  )
   at ActiproSoftware.Internal.DJ1..ctor(SyntaxEditor  , Point  , Boolean  )
   at ActiproSoftware.Windows.Controls.SyntaxEditor.SyntaxEditor.HitTest(Point point)
   at ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.zLm(Object  , InputPointerEventArgs  )
   at ActiproSoftware.Windows.Input.InputAdapter.h1P(Object  , InputEventArgs  )
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
   at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, IList`1 otherOrigins, DeferredElementTreeState& oldTreeState, Action`2 originChangedAction)
   at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, Int32 timestamp)
   at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.MouseDevice.Synchronize()
   at System.Windows.Controls.Primitives.Track.OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.PropertyChangedCallback.Invoke(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)
   at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(DependencyProperty property)
   at System.Windows.UIElement.OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)
   at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(Visual v, DependencyProperty property)
   at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(DependencyProperty property)
   at System.Windows.UIElement.OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.PropertyChangedCallback.Invoke(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)
   at System.Windows.Controls.Primitives.ScrollBar.ViewChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.PropertyChangedCallback.Invoke(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at ActiproSoftware.Internal.yJr.buw()
   at ActiproSoftware.Internal.yJr.OnViewTextAreaLayout(Object sender, TextViewTextAreaLayoutEventArgs e)
The second one is a little shorter:
System.InvalidOperationException: The specified Visual is not a descendant of this Visual.
   at System.Windows.Media.Visual.TrySimpleTransformToAncestor(Visual ancestor, Boolean inverse, GeneralTransform& generalTransform, Matrix& simpleTransform)
   at System.Windows.Media.Visual.TransformToDescendant(Visual descendant)
   at ActiproSoftware.Internal.u2R.OiY(Visual  , Visual  )
   at ActiproSoftware.Internal.DJ1..ctor(SyntaxEditor  , Point  , Boolean  )
   at ActiproSoftware.Windows.Controls.SyntaxEditor.SyntaxEditor.HitTest(Point point)
   at ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.Implementation.QuickInfoProviderBase.RYi(IEditorView  , InputPointerEventArgs  )
   at ActiproSoftware.Windows.Controls.SyntaxEditor.IntelliPrompt.Implementation.QuickInfoProviderBase.ActiproSoftware.Windows.Controls.SyntaxEditor.IEditorViewPointerInputEventSink.NotifyPointerHovered(IEditorView view, InputPointerEventArgs e)
   at ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.DL7()
   at ActiproSoftware.Internal.C29.vaV()
   at ActiproSoftware.Internal.C29.oaX(vya  )
   at ActiproSoftware.Internal.C29.vax(vya  , Int32  )
   at ActiproSoftware.Internal.C29.vya.Start(Int32  )
   at ActiproSoftware.Windows.Controls.SyntaxEditor.SyntaxEditor.kNa(Object  )


Best regards, Tobias Lingemann.

Comments (1)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

Thanks for reporting this.  For the next maintenance release, we are going to add a descendant visual check prior to attempting the transform.


Actipro Software Support

The latest build of this product (v24.1.3) was released 3 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.