This is a migrated thread and some comments may be shown as answers.

Recursive Call To Automation Peer Error

6 Answers 69 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Jonah
Top achievements
Rank 1
Jonah asked on 18 Sep 2014, 03:31 PM
So myself and another developer are working on the same program. On my computer, everything works fine. On his in development mode, or on others at run time, I get this error. I have seen this error on other posts but they look fairly dated and take care of. Anyone else have issues with this?


at System.Windows.Automation.Peers.AutomationPeer.GetChildren()
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.ValidateConnected(AutomationPeer connectedPeer)
   at MS.Internal.Automation.ElementProxy.StaticWrap(AutomationPeer peer, AutomationPeer referencePeer)
   at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)
   at System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
   at System.Windows.Automation.Peers.AutomationPeer.ResetChildrenCache()
   at Telerik.Windows.Automation.Peers.RadTabControlAutomationPeer.GetChildrenCore()
   at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
   at System.Windows.Automation.Peers.AutomationPeer.GetChildren()
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)
   at System.Windows.Automation.Peers.AutomationPeer.ValidateConnected(AutomationPeer connectedPeer)
   at MS.Internal.Automation.ElementProxy.StaticWrap(AutomationPeer peer, AutomationPeer referencePeer)
   at System.Windows.Automation.Peers.AutomationPeer.ProviderFromPeer(AutomationPeer peer)
   at System.Windows.Automation.Peers.AutomationPeer.RaiseAutomationEvent(AutomationEvents eventId)
   at System.Windows.Automation.Peers.SelectorAutomationPeer.RaiseSelectionEvents(SelectionChangedEventArgs e)
   at System.Windows.Controls.ListBox.OnSelectionChanged(SelectionChangedEventArgs e)
   at System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(List`1 unselectedInfos, List`1 selectedInfos)
   at System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
   at System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(ItemInfo info, Boolean assumeInItemsCollection)
   at System.Windows.Controls.Primitives.Selector.SetSelectedToCurrent()
   at System.Windows.Controls.Primitives.Selector.OnItemsChanged(NotifyCollectionChangedEventArgs e)
   at System.Windows.Controls.ItemsControl.OnItemCollectionChanged2(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at System.Windows.Controls.ItemCollection.OnViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at System.Windows.Data.ListCollectionView.RefreshOverride()
   at System.Windows.Data.CollectionView.RefreshInternal()
   at System.Windows.Data.CollectionView.Refresh()
   at System.Windows.Data.CollectionView.EndDefer()
   at System.Windows.Data.CollectionView.DeferHelper.Dispose()
   at System.Windows.Controls.ItemCollection.SetCollectionView(CollectionView view)
   at System.Windows.Controls.ItemCollection.SetItemsSource(IEnumerable value, Func`2 GetSourceItem)
   at System.Windows.Controls.ItemsControl.OnItemsSourceChanged(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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.Activate(Object item)
   at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
   at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
   at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
   at MS.Internal.Data.DataBindEngine.Run(Object arg)
   at MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
   at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation..

6 Answers, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 19 Sep 2014, 09:09 AM
Hello Jonah,

We have tried to reproduce the issue on our side but with no success. That is why I would like to ask you for more information:
- what is the exact version of your binaries?
- when does the issue occur?
- what exception do you get when the error occur?
- does the error occur on a PC with touch monitor or on a touch device?

Can you provide us with a sample project in which you have reproduced the issue as we are not sure what might have caused the issue.

Also if you are not using the automation peers since Q2 2014 SP you can now disable them, you can find more information on how to do that in this article.

Looking froward to hearing from you.

Kind regards,
Kiril Vandov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Jonah
Top achievements
Rank 1
answered on 19 Sep 2014, 02:05 PM
Version 2014.2.729.45
This occurs when I bind an image to a RadImageEditor that is inside a RadTabControl
The RadImageEditor has a converter that will convert it from a byte array to a RadImage and back
Exception: Recursive call to Automation Peer API is not valid.
Error occurs on a PC without a touch monitor
My project is very large and requires a connection to my internal database.
0
Jonah
Top achievements
Rank 1
answered on 19 Sep 2014, 02:16 PM
I went and disabled the automation and that seemed to do the trick.
0
Kiril Vandov
Telerik team
answered on 23 Sep 2014, 03:06 PM
Hello Jonah,

We were not able to reproduce the issue with a RadTabControl and an ImageEditor inside one of its TabItems. The automation peers errors are one of the hardest to reproduce as they depend on multiple conditions, such as OS, the content of the application, third party tools for inspection.
We will be happy to further investigate the issue if you can provide us with a sample project in which we can reproduce it on our side.

Kind regards,
Kiril Vandov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Timo
Top achievements
Rank 1
answered on 30 Aug 2018, 08:11 AM

Although this is quite an old thread, I now have a similar issue.

It seems to occur on touch devices only. Please tell me if I can provide additional information. Unfortunately, I will not be able to share code.

 

Telerik Version: 2018.2.260.45

Reproducible on Lenovo X230 (Win 7, .Net 6.1 Pack 1) and Toshiba Portege Z20t-C (Win 10, .Net 6.2)

 

System.InvalidOperationException: Recursive call to Automation Peer API is not valid.
  Data: System.Object = null
  at System.Windows.Automation.Peers.AutomationPeer.GetChildren()
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.ValidateConnected(System.Windows.Automation.Peers.AutomationPeer)
  at MS.Internal.Automation.ElementProxy.StaticWrap(System.Windows.Automation.Peers.AutomationPeer,System.Windows.Automation.Peers.AutomationPeer)
  at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(System.Int32)
  at Telerik.Windows.Automation.Peers.RadTabControlAutomationPeer.GetChildrenCore()

0
Martin Ivanov
Telerik team
answered on 31 Aug 2018, 07:24 AM
Hello Timo,

Thank you for the information provided so far. However, we are not aware of this error and we can't tell what could causing it using the stack trace from you reply. It would be very helpful if you could provide a runnable project showing the issue.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TabControl
Asked by
Jonah
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Jonah
Top achievements
Rank 1
Timo
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or