Hello, I am encountering the following error while using Unity’s Test Framework:
ArgumentException: An item with the same key has already been added. Key:
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <787acc3c9a4c471ba7d971300105af24>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <787acc3c9a4c471ba7d971300105af24>:0)
System.Linq.Enumerable.ToDictionary[TSource,TKey] (System.Collections.Generic.List`1[T] source, System.Func`2[T,TResult] keySelector, System.Collections.Generic.IEqualityComparer`1[T] comparer) (at <dab7f68612224ba3ae40f651d44f9d4c>:0)
System.Linq.Enumerable.ToDictionary[TSource,TKey] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Collections.Generic.IEqualityComparer`1[T] comparer) (at <dab7f68612224ba3ae40f651d44f9d4c>:0)
System.Linq.Enumerable.ToDictionary[TSource,TKey] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector) (at <dab7f68612224ba3ae40f651d44f9d4c>:0)
UnityEditor.TestTools.TestRunner.GUI.TestListGUI.get_ResultsByKey () (at ./Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/GUI/Views/TestListGUIBase.cs:44)
UnityEditor.TestTools.TestRunner.GUI.TestListTreeViewDataSource.FetchData () (at ./Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/GUI/TestListTreeView/TestListTreeViewDataSource.cs:35)
UnityEditor.IMGUI.Controls.TreeViewDataSource.ReloadData () (at <fe7039efe678478d9c83e73bc6a6566d>:0)
UnityEditor.IMGUI.Controls.TreeViewController.ReloadData () (at <fe7039efe678478d9c83e73bc6a6566d>:0)
UnityEditor.TestTools.TestRunner.GUI.TestListGUI.Reload () (at ./Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/GUI/Views/TestListGUIBase.cs:202)
UnityEditor.TestTools.TestRunner.TestRunnerWindow+<>c__DisplayClass27_0.<StartRetrieveTestList>b__0 (UnityEditor.TestTools.TestRunner.Api.ITestAdaptor rootTest) (at ./Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/TestRunnerWindow.cs:162)
UnityEditor.TestTools.TestRunner.Api.TestRunnerApi+<>c__DisplayClass8_0.<RetrieveTestList>b__0 (UnityEditor.TestTools.TestRunner.Api.ITestAdaptor testRoot) (at ./Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/Api/TestRunnerApi.cs:143)
UnityEditor.TestTools.TestRunner.TestListJob.EditorUpdate () (at ./Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/TestRunner/Utils/TestListJob.cs:31)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <fe7039efe678478d9c83e73bc6a6566d>:0)
This issue occurs when opening the [Test Runner] window in Unity. I am using Unity version 2022.3.2f1 and the operating system is [windows 11].
What I’ve tried so far:
Completely reinstalling Unity (both Unity Hub and Unity Editor).
Trying different versions of Unity.2022.3.10f1,2022.3.15f1
Deleting the Library folder and restarting the project.
Tested in a new project.
Restarting my computer.
Checking for updates on my operating system and drivers.
Reason for uninstalling and reinstalling Unity, UnityHub
- Create a new completely empty project
- Open the test runner window.
3.Open EditMode tab
This also results in the same error
I would greatly appreciate any advice or suggestions on this issue. If there are other steps or actions that I should try, I welcome those suggestions as well. Thank you in advance for your assistance.
This post was created using automatic translation.