Status Tool Error: «An item with the same key has already been added»
Problem: When I press the properties («cogwheel») button an error message «An item with the same key has already been added» is displayed.
Solution: The environment.db file in the model folder is corrupt. You need to delete the file and reopen the model. Then the Status Tool should work normally.
Error: «An item with the same key has already been added»
This article helps to fix the error «An item with the same key has already been added».
Applies to: Windows Server 2012 R2
Original KB number: 2002405
Symptoms
When you run the Validate a Configuration wizard for Windows Server 2008 Failover Cluster, you may receive the following error:
«An error occurred while executing the test. There was an error verifying the firewall configuration. An item with the same key has already been added.»
Cause
This error is reported if any network adapters have the same Globally Unique Identifier (GUID) across any nodes in the cluster. This can be determined by running the following WMI query on each node in the cluster and comparing the results —
For example, from inside PowerShell, run: — Get-WMIObject Win32_NetworkAdapter | fl Name, Guid
A sample output for an adapter would look like this —
Name : Intel(R) PRO/1000 MT Desktop Adapter
GUID:
This scenario typically occurs if an operating system image is being used to deploy cluster nodes and that image was not correctly prepared for deployment by running sysprep.
Resolution
To resolve this issue the network interface GUID’s on each of the nodes must be unique. One node can be left unchanged. But the following process must be performed against the remaining nodes.
- Download and then install the latest version of the network adapter driver on the computer.
- Click Start, click Run, type regedit, and then click OK.
- Locate and then delete the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\Config
- If your server is a domain controller, go to step 5. If your server is not a domain controller, delete the following registry subkeys:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Adapters\
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\ - Click Start, click Run, type sysdm.cpl, and then click OK.
- In the Systems Properties dialog box, click the Hardware tab, and then click Device Manager.
- In Device Manager, expand Network adapters, right-click the network adapter that you want, and then click Uninstall.
- Restart the computer.
To verify that the network interface GUID was updated, use one of the following methods.
Method 1: Perform the following:
Get-WMIObject Win32_NetworkAdapter | fl Name, Guid
Method 2: Run Failover Cluster’s Validate a Configuration wizard, and make sure that the error does not occur.
Saved searches
Use saved searches to filter your results more quickly
Cancel Create saved search
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ItemContainerGenerator System.ArgumentException An item with the same key has already been added #7467
wieslawsoltes opened this issue Jan 29, 2022 · 3 comments · Fixed by #9677
ItemContainerGenerator System.ArgumentException An item with the same key has already been added #7467
wieslawsoltes opened this issue Jan 29, 2022 · 3 comments · Fixed by #9677
Comments
Contributor
wieslawsoltes commented Jan 29, 2022 •
Describe the bug
System.ArgumentException: An item with the same key has already been added. Key: [1, Avalonia.Controls.Generators.ItemContainerInfo] at System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item) at System.Collections.Generic.SortedSet`1.Add(T item) at System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value) at Avalonia.Controls.Generators.ItemContainerGenerator.MoveContainer(Int32 oldIndex, Int32 newIndex, Object item) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Generators\ItemContainerGenerator.cs:line 217 at Avalonia.Controls.Generators.ItemContainerGenerator`1.TryRecycle(Int32 oldIndex, Int32 newIndex, Object item) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Generators\ItemContainerGenerator`1.cs:line 91 at Avalonia.Controls.Presenters.ItemVirtualizerSimple.RecycleContainersForMove(Int32 delta) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemVirtualizerSimple.cs:line 432 at Avalonia.Controls.Presenters.ItemVirtualizerSimple.set_OffsetValue(Double value) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemVirtualizerSimple.cs:line 68 at Avalonia.Controls.Presenters.ItemVirtualizerSimple.ScrollIntoViewCore(Int32 index) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemVirtualizerSimple.cs:line 543 at Avalonia.Controls.Presenters.ItemVirtualizerSimple.ScrollIntoView(Int32 index) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemVirtualizerSimple.cs:line 297 at Avalonia.Controls.Presenters.ItemsPresenter.ScrollIntoView(Int32 index) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemsPresenter.cs:line 133 at Avalonia.Controls.Primitives.SelectingItemsControl.ScrollIntoView(Int32 index) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Primitives\SelectingItemsControl.cs:line 362 at Avalonia.Controls.Primitives.SelectingItemsControl.AutoScrollToSelectedItemIfNecessary() in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Primitives\SelectingItemsControl.cs:line 848 at Avalonia.Controls.Primitives.SelectingItemsControl.OnSelectionModelPropertyChanged(Object sender, PropertyChangedEventArgs e) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Primitives\SelectingItemsControl.cs:line 763 at Avalonia.Controls.Selection.SelectionModel`1.RaisePropertyChanged(String propertyName) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Selection\SelectionModel.cs:line 277 at Avalonia.Controls.Selection.SelectionModel`1.CommitOperation(Operation operation, Boolean raisePropertyChanged) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Selection\SelectionModel.cs:line 726 at Avalonia.Controls.Selection.SelectionModel`1.EndBatchUpdate() in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Selection\SelectionModel.cs:line 214 at Avalonia.Controls.Selection.SelectionModel`1.BatchUpdateOperation.Dispose() in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Selection\SelectionModel.cs:line 764 at Avalonia.Controls.Selection.SelectionModel`1.SelectRange(Int32 start, Int32 end, Boolean forceSelectedIndex, Boolean forceAnchorIndex) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Selection\SelectionModel.cs:line 565 at Avalonia.Controls.Selection.SelectionModel`1.Select(Int32 index) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Selection\SelectionModel.cs:line 235 at Avalonia.Controls.Primitives.SelectingItemsControl.OnContainersMaterialized(ItemContainerEventArgs e) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Primitives\SelectingItemsControl.cs:line 430 at Avalonia.Controls.ItemsControl.b__12_0(Object _, ItemContainerEventArgs e) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\ItemsControl.cs:line 93 at Avalonia.Controls.Generators.ItemContainerGenerator.Materialize(Int32 index, Object item) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Generators\ItemContainerGenerator.cs:line 59 at Avalonia.Controls.Presenters.ItemVirtualizerSimple.CreateAndRemoveContainers() in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemVirtualizerSimple.cs:line 334 at Avalonia.Controls.Presenters.ItemVirtualizerSimple.UpdateControls() in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemVirtualizerSimple.cs:line 161 at Avalonia.Controls.VirtualizingStackPanel.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\VirtualizingStackPanel.cs:line 87 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Controls.Presenters.ItemVirtualizerSimple.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemVirtualizerSimple.cs:line 154 at Avalonia.Controls.Presenters.ItemsPresenter.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ItemsPresenter.cs:line 139 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Controls.Presenters.ScrollContentPresenter.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ScrollContentPresenter.cs:line 253 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Grid.cs:line 1150 at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Grid.cs:line 1005 at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Grid.cs:line 968 at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Grid.cs:line 427 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 625 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\LayoutHelper.cs:line 46 at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\LayoutHelper.cs:line 39 at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Border.cs:line 189 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 625 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\StackPanel.cs:line 207 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\StackPanel.cs:line 207 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\StackPanel.cs:line 207 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Grid.cs:line 230 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Grid.cs:line 230 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\LayoutHelper.cs:line 46 at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\LayoutHelper.cs:line 39 at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Presenters\ContentPresenter.cs:line 366 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\LayoutHelper.cs:line 46 at Avalonia.Controls.Decorator.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Decorator.cs:line 54 at Avalonia.Controls.Primitives.VisualLayerManager.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Primitives\VisualLayerManager.cs:line 133 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 625 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 559 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 625 at Avalonia.Controls.Window.MeasureOverride(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Window.cs:line 904 at Avalonia.Controls.WindowBase.MeasureCore(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\WindowBase.cs:line 244 at Avalonia.Layout.Layoutable.Measure(Size availableSize) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\Layoutable.cs:line 364 at Avalonia.Layout.LayoutManager.Measure(ILayoutable control) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\LayoutManager.cs:line 287 at Avalonia.Layout.LayoutManager.ExecuteInitialLayoutPass() in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Layout\LayoutManager.cs:line 174 at Avalonia.Controls.Window.ShowCore(Window parent) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Window.cs:line 689 at Avalonia.Controls.Window.Show() in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\Window.cs:line 627 at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.ShowMainWindow() in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\ApplicationLifetimes\ClassicDesktopStyleApplicationLifetime.cs:line 128 at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\ApplicationLifetimes\ClassicDesktopStyleApplicationLifetime.cs:line 118 at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in C:\DOWNLOADS\GitHub\Avalonia\src\Avalonia.Controls\ApplicationLifetimes\ClassicDesktopStyleApplicationLifetime.cs:line 209 at Sandbox.Program.Main(String[] args) in C:\DOWNLOADS\GitHub\Avalonia\samples\Sandbox\Program.cs:line 7
To Reproduce
Window xmlns="https://github.com/avaloniaui" xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' x:Class="Sandbox.MainWindow"> ListBox BorderThickness="1"> ListBoxItem Content="Unselected"/> ListBoxItem Content="Selected" IsSelected="True"/> ListBoxItem Content="Disabled" IsEnabled="False"/> ListBox> Window>
Expected behavior
No Exception
Desktop (please complete the following information):
- OS: Windows 10
- Version 0.10.12 and master
An item with the same key has already been added
15,872,616 members
Sign in
Sign in with
Advertise
Privacy
Cookies
Terms of Use
Last Updated 6 Dec 2022
Copyright © CodeProject, 1999-2024
All Rights Reserved.
CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900