Hi,
I am running Infragisitcs 13.1.20131.2406. Whenever I move the WPF Window around, maximize or minimize it in Windows 10, I would get a cross thread issue.
– MAIN EXCEPTION –System.Reflection.TargetInvocationExceptionat System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)at Infragistics.AutomationPeers.AutomationPeerProxy.GetChildrenCore()at Infragistics.Windows.Automation.Peers.DataPresenter.RecordAutomationPeer.GetChildrenCore()at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)at System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()at System.Windows.Automation.Peers.AutomationPeer.UpdatePeer(Object arg)at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
– INNER EXCEPTION –System.InvalidOperationExceptionThe calling thread cannot access this object because a different thread owns it.at System.Windows.Threading.Dispatcher.VerifyAccess()at System.Windows.Media.Imaging.BitmapDecoder.ToString()at System.Windows.Media.Imaging.BitmapFrameDecode.ConvertToString(String format, IFormatProvider provider)at System.Windows.Media.ImageSource.ToString()at System.Windows.Controls.ContentControl.ContentObjectToString(Object content)at System.Windows.Controls.ContentControl.GetPlainText()at System.Windows.Automation.Peers.FrameworkElementAutomationPeer.GetNameCore()at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
My team has figured out the problem. The cause is similar to WinForm cross thread exception in some way. What happens was the WPF controls are data-bind to a number of ObversableCollections that were updated by .net remoting worker threads.
To fix the issue, I added code to store the Main thread's Dispatcher, and changed the code so that the worker thread need to check the main thread's call Dispatcher.Invoke() if the Dispatcher.CheckAccess() is false.
This issue was not obvious in the beginning due to:
A. The crash seems to only happen on a QA Windows 10 32 bit (VM), never see it happen on dev's machine 64 bit.B. It only happens when the user moves or resizes the application windows. The stack trace never hits the user code, and it is not crashing at the point when the work thread updates the data.
While WinForm would crash immediately (CrossThreadException) if the data-bind contents are updated by a non-UI thread, WPF controls or backend code crashes at some other points.
Thank you for putting a sample together.The Release Notes for different versions and platforms could be found at: http://ko.infragistics.com/community/blogs/engineering/default.aspx
Hi Maria, so far the issue only happens for Windows 10. There does not seem to be any issue for Windows 8 or 7 as far as I know. Our company didn't have the license for 14.2 so I can't tell if this issue is resolved in the newer version or not. If there is a way to search through the release notes to see if the issue is fix, that would help a lot.
Meanwhile, I will try to work on a sample project to reproduce the issue.
Hello and thank you for posting!
Windows 10 is actually supported with version 14.2 and later so there might be an issue with the 13.1. Do you receive the same error if you are running on Windows 8/7 or with 14.2 assemblies? Would it be possible to share a sample project that illustrates the issue? Thank you in advance.