Rhino8 Opening Properties or Layers panel may occasionally cause an error

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]

Hi @王佳伟,

Can you please run Rhino’s SystemInfo command and post the output in a reply?

Thanks,

– Dale

Rhino 8 SR9 2024-7-12 (Rhino 8, 8.9.24194.18121, Git hash:master @ 785b9fde79bb684d22aab317998f7195a8c27c14)
License type: Commercial, 版本2024-07-12
License details: Cloud Zoo

Windows 11 (10.0.22631 SR0.0) or greater (Physical RAM: 16GB)
.NET 7.0.0

Computer platform: LAPTOP - Plugged in [100% battery remaining]

Hybrid graphics configuration.
Primary display: Intel(R) UHD Graphics (Intel) Memory: 1GB, Driver date: 6-1-2021 (M-D-Y).
> Integrated graphics device with 3 adapter port(s)
- Windows Main Display is laptop’s integrated screen or built-in port
Primary OpenGL: NVIDIA GeForce RTX 2060 (NVidia) Memory: 6GB, Driver date: 1-18-2024 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 551.23
> Integrated accelerated graphics device with 4 adapter port(s)
- Secondary monitor is laptop’s integrated screen or built-in port

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)

Anti-alias mode: 8x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 1-18-2024
Driver Version: 31.0.15.5123
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 6 GB

Rhino plugins that do not ship with Rhino
C:\Users\open\AppData\Roaming\McNeel\Rhinoceros\BlockEditNew\BlockEditNew.rhp “BlockEdit” 1.0.0.0

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 8\Plug-ins\Commands.rhp “Commands” 8.9.24194.18121
C:\Program Files\Rhino 8\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 8\Plug-ins\RhinoRenderCycles.rhp “Rhino 渲染” 8.9.24194.18121
C:\Program Files\Rhino 8\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 8.9.24194.18121
C:\Program Files\Rhino 8\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 8\Plug-ins\MeshCommands.rhp “MeshCommands” 8.9.24194.18121
C:\Program Files\Rhino 8\Plug-ins\RhinoCycles.rhp “RhinoCycles” 8.9.24194.18121
C:\Program Files\Rhino 8\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 8.9.24194.18121
C:\Program Files\Rhino 8\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 8\Plug-ins\Displacement.rhp “Displacement”
C:\Program Files\Rhino 8\Plug-ins\SectionTools.rhp “SectionTools”