Hello.
I'm using Infragistics WPF4 v11.2 and getting following exceptions every once in a while:
First one
System.NullReferenceException: Object reference not set to an instance of an object.at Infragistics.DragDrop.WeakReferenceExtensions.Contains(IList`1 list, DependencyObject item)at Infragistics.DragDrop.DragDropManager.OnDragSourceChanged(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 Infragistics.Controls.Menus.XamDataTreeNodeControl.set_Node(XamDataTreeNode value)at Infragistics.Controls.Menus.XamDataTreeNodeControl.OnAttached(XamDataTreeNode node)at Infragistics.Controls.Menus.XamDataTreeNode.OnElementAttached(XamDataTreeNodeControl element)at Infragistics.DependencyObjectRecyclingContainer`1.Infragistics.ISupportRecycling.OnElementAttached(FrameworkElement elem)at Infragistics.RecyclingManager.PanelInfo.AttachElement(ISupportRecycling obj)at Infragistics.Controls.Menus.Primitives.NodesPanel.RenderNode(XamDataTreeNode node, Double availableWidth)at Infragistics.Controls.Menus.Primitives.NodesPanel.MeasureOverride(Size availableSize)at System.Windows.FrameworkElement.MeasureCore(Size availableSize)at System.Windows.UIElement.Measure(Size availableSize)at Infragistics.Controls.Menus.Primitives.NodesPanel.MeasureOverride(Size availableSize)at System.Windows.FrameworkElement.MeasureCore(Size availableSize)at System.Windows.UIElement.Measure(Size availableSize)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.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)at System.Windows.Interop.HwndTarget.OnResize()at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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(Object o)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.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)at MS.Win32.UnsafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)at System.Windows.Window.ShowHelper(Object booleanBox)at System.Windows.Window.Show()at HFA.View.Utils.ApplicationUtils.<>c__DisplayClass2.<ShowWindowOnNewThread>b__0() in c:\BuildAgent\work\3bc9df67e650ff91\Core\UI\View\Utils\ApplicationUtils.cs:line 96at System.Threading.ThreadHelper.ThreadStart_Context(Object state)at System.Threading.ExecutionContext.runTryCode(Object userData)at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.ThreadHelper.ThreadStart()
And second one
[2013-01-14 15:28:28,055] ERROR [HFA.Photon.App] - Dispatcher[2013-01-14 15:28:28,055] ERROR [HFA.Photon.App] - Exception has been thrown by the target of an invocation.[2013-01-14 15:28:28,055] ERROR [HFA.Photon.App] - System.Reflection.TargetInvocationException[2013-01-14 15:28:28,118] ERROR [HFA.Photon.App] - at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)at System.Delegate.DynamicInvokeImpl(Object[] args)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)[2013-01-14 15:28:28,118] ERROR [HFA.Photon.App] - Inner Exception: [2013-01-14 15:28:28,118] ERROR [HFA.Photon.App] - Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index[2013-01-14 15:28:28,118] ERROR [HFA.Photon.App] - System.ArgumentOutOfRangeException[2013-01-14 15:28:28,133] ERROR [HFA.Photon.App] - at System.ThrowHelper.ThrowArgumentOutOfRangeException()at Infragistics.Collections.WeakList`1.GetItemHelper(Int32 index)at Infragistics.Windows.Internal.ThrottleTimer.OnTimerTick_Sync()
I'm not sure what is triggering these exceptions. I only have logs from production users.
Please advise how to avoid this.
Hello,
Since this is not a known issue, we are not able to reproduce this beahavior and if you send us an isolated sample project, where this is reproduced we will be glad to assist you further with this.
Looking forward for your reply.
Also I'd like to understand can I expect this to be fixed in recent releses?
Sorry guys, my post above is actually about another exception from your code. I thought I reported that too. Here it is:
ystem.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException() at Infragistics.Collections.WeakList`1.GetItemHelper(Int32 index) at Infragistics.Windows.Internal.ThrottleTimer.OnTimerTick_Sync() --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Delegate.DynamicInvokeImpl(Object[] args) 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.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) 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(Object o) 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.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window)
So
1) There was an exception that was thrown from Infragistics code.
2) This is kind of code customer can't control anyhow. I did not call anything to get this exception. Your internal timer was fired and it tried to get access to your internal weak list on the wrong index.
3) That happens very-very rare
And you are saying that I have to provide you a sample that allows you to reproduce that before you will start looking into that, right? So in you opinion I have to decompile your code, find out how this issue is possible, create a sample that reproduces the issue using your public API only and then you will start looking into that. It seems Infragistics provides very nice support.
By the way, could you please explain is it safe to handle this exception in dispatcher exception handler and ignore it? Will your components operate correct after that? Or I have to restart application anyway?
Since this is not a known issue I am not able to investiagate this further without an isolated sample, where it is reproduced. Also I can say that currently there is no logging available for Infragistics controls.