5.1 Error: System.ArgumentException: An item with the same key has already been added.

My project that was working in 5.0.2, newly converted, is now throwing this error. Double-clicking the error doesn’t get me to the LOC that’s responsible, nor is there any indication of what assembly dll might be causing it.

The only precompiled asset I have installed is “MathLibraryForUnity”, and a lot of stuff depends on it, so I can’t delete it.

Tried to delete random dll’s to no avail. Here’s the compiler log:

Building: Assembly-UnityScript (Debug)
Performing main compilation…
-base:UnityEngine.MonoBehaviour
-method:Main
-i:System.Collections
-i:UnityEngine
-i:UnityEditor
-t:library
-x-type-inference-rule-attribute:UnityEngineInternal.TypeInferenceRuleAttribute
-debug+
-out:C:\Users\albamuth\Documents\SeedApp\Temp\bin\Debug\Assembly-UnityScript.dll
-define:smile:EBUG
-define:TRACE
-define:UNITY_5_1_0
-define:UNITY_5_1
-define:UNITY_5
-define:ENABLE_NEW_BUGREPORTER
-define:ENABLE_2D_PHYSICS
-define:ENABLE_4_6_FEATURES
-define:ENABLE_AUDIO
-define:ENABLE_CACHING
-define:ENABLE_CLOTH
-define:ENABLE_FRAME_DEBUGGER
-define:ENABLE_GENERICS
-define:ENABLE_HOME_SCREEN
-define:ENABLE_IMAGEEFFECTS
-define:ENABLE_LIGHT_PROBES_LEGACY
-define:ENABLE_MULTIPLE_DISPLAYS
-define:ENABLE_PHYSICS
-define:ENABLE_PHYSICS_PHYSX3
-define:ENABLE_PLUGIN_INSPECTOR
-define:ENABLE_SHADOWS
-define:ENABLE_SINGLE_INSTANCE_BUILD_SETTING
-define:ENABLE_SPRITES
-define:ENABLE_TERRAIN
-define:ENABLE_UNET
-define:ENABLE_UNITYEVENTS
-define:ENABLE_VR
-define:ENABLE_WWW
-define:ENABLE_CLOUD_SERVICES
-define:ENABLE_CLOUD_SERVICES_ANALYTICS
-define:ENABLE_CLOUD_SERVICES_UNET
-define:ENABLE_CLOUD_LICENSE
-define:ENABLE_AUDIOMIXER_SUSPEND
-define:ENABLE_EDITOR_METRICS
-define:INCLUDE_DYNAMIC_GI
-define:INCLUDE_GI
-define:INCLUDE_IL2CPP
-define:INCLUDE_DIRECTX12
-define:RENDER_SOFTWARE_CURSOR
-define:ENABLE_LOCALIZATION
-define:UNITY_WEBGL
-define:ENABLE_TEXTUREID_MAP
-define:ENABLE_CRUNCH_TEXTURE_COMPRESSION
-define:ENABLE_IL2CPP
-define:ENABLE_PROFILER
-define:smile:EBUG
-define:TRACE
-define:UNITY_ASSERTIONS
-define:UNITY_EDITOR
-define:UNITY_EDITOR_64
-define:UNITY_EDITOR_WIN
-reference:‘C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll’
-reference:‘C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll’
-reference:‘C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll’
-reference:‘C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll’
-reference:‘C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll’
-reference:‘C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll’
-reference:‘C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll’
-reference:‘C:/Users/albamuth/Documents/SeedApp/Assets/MathLibraryForUnity/Lib/DestMath.dll’
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\CameraScript.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\DebugGUI.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\DimHandleBehavior.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\Dimensions.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\DummyLimits.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\EdgeBehaviorScript.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\EdgeInfoScript.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\FaceBehaviorScript.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\FaceCollider.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\FaceCurvature.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\FaceInfoScript.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\GUIButtonLaunch.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\GeometryMethods.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\IntroGUILaunch.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\Label.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\LoadScene.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\PointLabel.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\Reader.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\Shape.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\ShapeChooser.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\ShapeOld.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\VersionInfo.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\VertexBehavior.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\VertexInfoScript.js”
“C:\Users\albamuth\Documents\SeedApp\Assets\Scripts\Writer.js”

Build complete – 1 error, 0 warnings

---------------------- Done ----------------------

Build: 1 error, 0 warnings

You can attach a debugger and set it to break on this specific exception type. this will give you a clue what’s going on.

Though it’s a bit dated, you can check out my article for a similar issue here: http://www.tallior.com/bug-hunting-unity-throws-an-argumentexception-when-building-for-android/

Just to get a basic idea of what you can do to pinpoint the issue.

Me_2 == :frowning:
Can’t compile ! unity 5.1.0f3 on Win8.1 with all latest updates.
“Error Error: System.ArgumentException: En post med samma nyckel har redan lagts till. (Error: System.ArgumentException) (Assembly-UnityScript-firstpass)”
(Sorry Swedish)
No indication on what key, and where
Can’t attach debugger. “(-) Could not connect to the debugger.”
Have tried to restarting Unity & MonoDevelope
Have written some new code, but “#if false” don’t fix the problem.
Now I will restart the computer ! = did not help.

Are you attaching to the editor? I am using MonoDevelop and i can easily attach to the editor using the debugger.

Trying to attach MonoDevlopment to UnityEditor gives:
2153279--142149--upload_2015-6-10_23-8-1.png
Also I have to double click on the "1372 Unitu Editor (unity) " line
Single clicking on [Attatch] button don’t work, double clicking does
2153279--142150--upload_2015-6-10_23-11-22.png

“Thankfully” my project haven’t come so fare, so I made a backup and deleted all assets except my own assets/scripts.
Now it compiles, a lot of surfaces are purple & I have to reinstall the assets one by one, to see what breaks the compiler.

Well …
“Error importing folder (The pathName assets/standard assets is already mapped to cadbc498d70ac144e9e18adc6f390859. But the meta data wants it to be mapped to b040dde55da46914999de41c666dac90)”

Unfortunately I couldn’t stay with this problem to debug it, reverting to Unity 5.0.3 for now…but when I have some free time (!) I’ll try attaching the process.