Page 1 of 1

ArgumentException

Posted: Thu Dec 04, 2014 6:48 am
by Jason
Hi there!

I'm getting this error for whatever reason:

ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,System.Object].Add (System.String key, System.Object value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
ES2Data.Add (System.String tag, System.Object value)
ES2Reader.ReadAll ()
ES2.LoadAll (System.String path)
GameManager.ReadData () (at Assets/Code/GameManager.cs:290)
GameManager.Awake () (at Assets/Code/GameManager.cs:205)

My code for loading this data is simply this:

Code: Select all

public void ReadData()
{
	string path = _worlds.CurrentWorld + "/Data.txt";
	
	if (ES2.Exists(path))
	{
		ES2Data data = ES2.LoadAll(path);

		if (OnLoad != null)
			OnLoad(data);
	}
}
Where it triggers an event and passes the data object to listeners, which can use it to load their specific data out of it.

I'm not entirely sure which details I can give, because I have no idea what is causing this error or where it's happening. It seems to be happening internally in that ES2Data.Add method, where the tag is a duplicate.

Is there a way I could have caused this error, or is it an Easy Save bug?

Thanks in advance.

Re: ArgumentException

Posted: Thu Dec 04, 2014 3:54 pm
by Joel
Hi Jason,

This appears to be a bug at our end, but it will be fixed in v2.54 which is currently awaiting approval from Unity.

All the best,
Joel