如何控制堆栈跟踪的深度

问题描述 投票:0回答:1

使用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) 
c# wpf stack-trace
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.