This may occur during the import process or other operations.
But It cannot be consistently reproduced.
It consistently throws an error, making Rhino unresponsive and requiring a restart to resolve
This issue can occur in both Rhino 8.10 and 8.11.
Error Message:
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: 某个 ItemsControl 与它的项源不一致。
请参见内部异常以获取更多信息。 ---> System.Exception: 针对开发人员的信息(使用文本可视化工具来阅读此内容):
引发此异常的原因是名为“(未命名)”的控件“Eto.Wpf.Forms.Controls.EtoDataGrid Items.Count:7”的生成器已接收到一个 CollectionChanged 事件序列,这些事件与 Items 集合的当前状态不符。 检测到以下差异:
累积计数 4 与实际计数 7 不相同。[累积计数的计算方式为: 上次重置时的计数 + 添加数 - 自上次重置后的删除数。]
位于索引位置 0: 生成器的项“Rhino.UI.DialogPanels.LayerItem”与实际项“Rhino.UI.DialogPanels.LayerItem”不相同。
位于索引位置 1: 生成器的项“Rhino.UI.DialogPanels.LayerItem”与实际项“Rhino.UI.DialogPanels.LayerItem”不相同。
位于索引位置 2: 生成器的项“Rhino.UI.DialogPanels.LayerItem”与实际项“Rhino.UI.DialogPanels.LayerItem”不相同。
(... 还有 1 个实例 ...)
以下的一个或多个源可能已引发错误事件:
System.Windows.Controls.ItemContainerGenerator
System.Windows.Controls.ItemCollection
System.Windows.Data.ListCollectionView
* Eto.Wpf.Forms.Controls.EtoGridCollectionView
(标有星号的源被认为更有可能是问题的根源。)
最常见的原因有: (a)在未引发相应事件的情况下更改了集合或集合的计数,(b)引发的事件使用了错误的索引或项参数。
异常的堆栈跟踪将描述不一致情况是如何检测到的,而不是描述不一致情况是如何发生的。 若要获得更及时的异常,应将生成器上附加的属性“PresentationTraceSources.TraceLevel”设置为值“High”,然后重新运行该方案。 完成此操作的一个方法是,在“即时”窗口中运行与下面的命令类似的命令:
System.Diagnostics.PresentationTraceSources.SetTraceLevel(myItemsControl.ItemContainerGenerator, System.Diagnostics.PresentationTraceLevel.High)
。这会使得在发生每个 CollectionChanged 事件之后运行检测逻辑,因此,这将减慢应用程序的运行速度。
--- 内部异常堆栈跟踪的结尾 ---
在 System.Windows.Controls.ItemContainerGenerator.Verify()
在 System.Windows.Controls.VirtualizingStackPanel.MeasureChild(IItemContainerGenerator& generator, IContainItemStorage& itemStorageProvider, IContainItemStorage& parentItemStorageProvider, Object& parentItem, Boolean& hasUniformOrAverageContainerSizeBeenSet, Double& computedUniformOrAverageContainerSize, Double& computedUniformOrAverageContainerPixelSize, Boolean& computedAreContainersUniformlySized, Boolean& hasAnyContainerSpanChanged, IList& items, Object& item, IList& children, Int32& childIndex, Boolean& visualOrderChanged, Boolean& isHorizontal, Size& childConstraint, Rect& viewport, VirtualizationCacheLength& cacheSize, VirtualizationCacheLengthUnit& cacheUnit, Int64& scrollGeneration, Boolean& foundFirstItemInViewport, Double& firstItemInViewportOffset, Size& stackPixelSize, Size& stackPixelSizeInViewport, Size& stackPixelSizeInCacheBeforeViewport, Size& stackPixelSizeInCacheAfterViewport, Size& stackLogicalSize, Size& stackLogicalSizeInViewport, Size& stackLogicalSizeInCacheBeforeViewport, Size& stackLogicalSizeInCacheAfterViewport, Boolean& mustDisableVirtualization, Boolean isBeforeFirstItem, Boolean isAfterFirstItem, Boolean isAfterLastItem, Boolean skipActualMeasure, Boolean skipGeneration, Boolean isAncestorLookingForFirstItem, Boolean& hasBringIntoViewContainerBeenMeasured, Boolean& hasVirtualizingChildren)
在 System.Windows.Controls.VirtualizingStackPanel.MeasureOverrideImpl(Size constraint, Nullable`1& lastPageSafeOffset, List`1& previouslyMeasuredOffsets, Nullable`1& lastPagePixelSize, Boolean remeasure)
在 System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)
在 System.Windows.Controls.Primitives.DataGridRowsPresenter.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
在 System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
在 System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
在 System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Border.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Control.MeasureOverride(Size constraint)
在 System.Windows.Controls.DataGrid.MeasureOverride(Size availableSize)
在 Eto.Wpf.Forms.WpfFrameworkElement`3.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:行号 121
在 Eto.Wpf.Forms.Controls.EtoDataGrid.MeasureOverride(Size constraint) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\Controls\GridHandler.cs:行号 24
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
在 System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
在 Eto.Wpf.Forms.EtoGrid.MeasureOverride(Size constraint) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\TableLayoutHandler.cs:行号 12
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Border.MeasureOverride(Size constraint)
在 Eto.Wpf.Forms.WpfFrameworkElement`3.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:行号 121
在 Eto.Wpf.Forms.TableLayoutHandler.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\TableLayoutHandler.cs:行号 189
在 Eto.Wpf.Forms.EtoBorder.MeasureOverride(Size constraint) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\EtoBorder.cs:行号 15
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
在 System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
在 System.Windows.Controls.Grid.MeasureOverride(Size constraint)
在 Eto.Wpf.Forms.EtoGrid.MeasureOverride(Size constraint) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\TableLayoutHandler.cs:行号 12
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Border.MeasureOverride(Size constraint)
在 Eto.Wpf.Forms.WpfFrameworkElement`3.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:行号 121
在 Eto.Wpf.Forms.TableLayoutHandler.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\TableLayoutHandler.cs:行号 189
在 Eto.Wpf.Forms.EtoBorder.MeasureOverride(Size constraint) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\EtoBorder.cs:行号 15
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Border.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Border.MeasureOverride(Size constraint)
在 Eto.Wpf.Forms.WpfFrameworkElement`3.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:行号 121
在 Eto.Wpf.Forms.WpfContainer`3.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfContainer.cs:行号 39
在 Eto.Wpf.Forms.EtoBorder.MeasureOverride(Size constraint) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\EtoBorder.cs:行号 15
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Border.MeasureOverride(Size constraint)
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.Controls.Border.MeasureOverride(Size constraint)
在 Eto.Wpf.Forms.WpfFrameworkElement`3.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:行号 121
在 Eto.Wpf.Forms.WpfContainer`3.MeasureOverride(Size constraint, Func`2 measure) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfContainer.cs:行号 39
在 Eto.Wpf.Forms.EtoBorder.MeasureOverride(Size constraint) 位置 D:\BuildAgent\work\dujour\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\EtoBorder.cs:行号 15
在 System.Windows.FrameworkElement.MeasureCore(Size availableSize)
在 System.Windows.UIElement.Measure(Size availableSize)
在 System.Windows.ContextLayoutManager.UpdateLayout()
在 System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
在 System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
在 System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
在 System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
[END ERROR]