Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
7
Question by OriginalCoder · Jun 09, 2015 at 01:07 PM · errormonodevelopupgrade

Monodevelop error after Unity 5.1 upgrade: An item with the same key has already been added.

I've just upgraded my project to Unity 5.1, and now monodevelop fails to build the project with the following error:

An item with the same key has already been added. (Error: System.ArgumentException) (Assembly-UnityScript)

I have lots of plugins (Standard Assets, iOSNative, ImageEffects among others), and can see no way of finding out where the problem is.

Anyone know how to narrow down where the problem might lie?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fisherdachs · Jun 09, 2015 at 06:01 PM 0
Share

same here. No idea what's causing it!

avatar image OriginalCoder · Jun 10, 2015 at 12:09 PM 0
Share

I've found that removing the iOSNative plugin files fixes the issue. However, this has the side effect of removing the Assembly-UnityScript project from the solution, so I am unsure if the fault is due to the Assembly-UnityScript being present, or something within the iOSNative plugin.

avatar image michaelgburton · Jun 15, 2015 at 01:19 PM 0
Share

Also having this issue in 5.1. If I remove Assembly-UnityScript it goes away, but this is regenerated every time.

avatar image jujulifer · Jun 15, 2015 at 02:52 PM 0
Share

I have the same issue in Unity 5.1.0, but it's working O$$anonymous$$ on Unity 5.0.3. I'm not sure how fix the issue, but removing the Assembly-UnityScript or changing to release is not a solution for me. So I'll be using Unity 5.0.3.

7 Replies

· Add your reply
  • Sort: 
avatar image
8

Answer by steveg2357 · Jun 16, 2015 at 03:38 PM

It looks like the error may be caused by DEBUG and TRACE occurring twice in the DefineConstants section of the Unity project files (i.e., .csproj and .unityproj files).

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tsht · Jun 19, 2015 at 06:28 AM 4
Share

Hello. You're right ! I edited this (click right on Assembly-UnityScript on the left tree, then Options, then Compiler and delete the first DEBUG;TRACE) and now it compiles correctly ! Thanks !

avatar image meteora8888 · Jun 22, 2015 at 10:53 AM 0
Share

Thanks :) this worked for me and is a really quick solution! :)

avatar image pedrevans · Jul 18, 2015 at 12:26 PM 0
Share

I had the same problem but the error message was "An element with the same key already exists in the dictionary". The solution was the same, delete the superfluous DEBUG and TRACE options.

avatar image PlanetAlexander · Sep 02, 2015 at 01:22 AM 0
Share

Having the same error. Since you seem to have found how to fix it, can you post instructions on how to do so? Sort of new to Unity.

avatar image opri · Mar 03, 2016 at 08:19 PM 0
Share

Hi, this has been haunting me for quite a while. This solution worked for me as well, thanks!

avatar image
3

Answer by jantje · Jun 15, 2015 at 09:56 PM

I filed a bug (703149) on this. Unfortunately, it's even simpler (although I found it with my 5.0.2 project when I opened it in 5.1). I made a new project in 5.1, and added a UnityScript .js file. Compiles fine in the Editor, but if you try to compile it in MonoDevelop (I'm on a Mac), you get the error. My personal theory is that the duplicate item(s) in question are the DEBUG and TRACE defines, as looking at the Application Output: Errors (click "Errors" at bottom right of MonoDevelop window), you see that they are in there twice, whereas if you compile in 5.0.x they are only there once. The 5.1 release notes mention those as having been touched in 5.1. But my guess could be incorrect.

While I can still debug with MonoDevelop, building in MonoDevelop gives that error and then won't try to compile the rest.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image OriginalCoder · Jun 16, 2015 at 09:07 AM 0
Share

Great, thanks. Hopefully they will fix it in a co$$anonymous$$g update.

avatar image Tsht · Jun 19, 2015 at 06:29 AM 1
Share

Yup. You can fix it manually for now Click right on Assembly-UnityScript on the left tree, then Options, then Compiler and delete the first DEBUG;TRACE

avatar image jantje · Jun 19, 2015 at 10:47 PM 0
Share

Awesome! Thanks for the tip! I had to do it for both Assembly-UnityScript AND Assempy-UnityScript-firstpass, but it worked!

Hello, 5.1, I can use you now :).

avatar image
1

Answer by $$anonymous$$ · Feb 23, 2016 at 02:39 PM

Had the same error. Just changed the build type from debug to release. It worked.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Daniel10 · Jun 09, 2016 at 05:36 PM 0
Share

This worked for me! In iOS Build Settings, change from release to debug, press "Build" and cancel the build. Change back to "Release" and all works fine.

avatar image
0

Answer by crohr · Jun 09, 2015 at 08:00 PM

I have had this issue in the past and simply had to remove an extra assembly reference in Mono. I unfortunately do not recall the name, but it is typically the last assembly reference in the solution. Sorry I am not able to remember to name.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image crohr · Jun 09, 2015 at 08:09 PM 0
Share

It is likely the Assembly-UnityScript, but I am uncertain. But I do know removing that Assembly reference doesn't harm anything.

avatar image OriginalCoder · Jun 10, 2015 at 12:00 PM 0
Share

Removing this reference didn't fix the issue.

avatar image
0

Answer by Steredice · Jun 13, 2015 at 07:08 PM

I had the same error. I tried changing the references, deleting some, etc. It didn't work. I just changed the build from debug to release. And no more error.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Error trying to open script with Monodevelop 3 Answers

Ending my game 3 Answers

Really need help for my code! 2 Answers

MonoDevelop TODO task won't clear. 2 Answers

Monodevelop Fatal Error 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges