如何控制stacktrace的深度

时间:2019-02-26 17:51:01

标签: c# wpf stack-trace

具有使用DevExpress的C#WPF应用程序。捕获一个未处理的异常,请参见下文,其中显示了System和DevExpress元素,但是我的任何源模块中都没有。几乎可以肯定,我的源模块之一是写入绑定到DevExpress PropertyGridControl的C#对象,然后抛出异常,但是哪个PropertyGridControl?有没有办法扩大或扩大堆栈跟踪深度,以查看在我的源代码中哪里发生了对C#对象的写入?

OnDispatcherUnhandledException occurred: Collection was modified after the enumerator was instantiated. 
at System.Collections.Specialized.ListDictionary.NodeKeyValueCollection.NodeKeyValueEnumerator.MoveNext()
at System.Linq.Enumerable.<CastIterator>d__94`1.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at DevExpress.Mvvm.Native.LinqExtensions.ForEach[T](IEnumerable`1 source, Action`1 action)
at DevExpress.Xpf.PropertyGrid.Internal.DataController.InvalidateChildren(IEnumerable`1 handles)
at DevExpress.Xpf.PropertyGrid.Internal.DataController.UpdateHandles()
at DevExpress.Xpf.PropertyGrid.Internal.DataController.Update()
at DevExpress.Xpf.PropertyGrid.Internal.DataViewBase.<Update>b__98_0()
at DevExpress.Xpf.Core.Locker.DoLockedAction(Action action)
at DevExpress.Xpf.Core.Locker.<>c__DisplayClass12_0.<DoLockedActionIfNotLocked>b__0()
at DevExpress.Xpf.Core.Locker.DoIfNotLocked(Action action)
at DevExpress.Xpf.Core.Locker.DoLockedActionIfNotLocked(Action action)
at DevExpress.Xpf.PropertyGrid.Internal.DataViewBase.Update()
at DevExpress.Xpf.PropertyGrid.PropertyGridControl.UpdateData()
at DevExpress.Xpf.PropertyGrid.PropertyGridView.<OnLayoutUpdated>b__103_0(PropertyGridControl x)
at DevExpress.Mvvm.Native.MayBe.Do[TI](TI input, Action`1 action)
at DevExpress.Xpf.PropertyGrid.PropertyGridView.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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 

1 个答案:

答案 0 :(得分:0)

值得称赞的是,DevExpress拥有一个导致我观察到的异常的实现。他们的代码异步处理DataContext绑定,因此显然在异步处理一个绑定更新时,同时发生的另一个绑定更新可能会导致kaboom。新版本即将发布...