Wednesday, September 7, 2016

An item with the same key has already been added.

Most likely, you have model which contains the same property twice. Perhaps you are using new to hide the base property.

Solution is to override the property or use another name.

If you share your model, we would be able to elaborate more.
or
This error is fairly self-explanatory. Dictionary keys are unique and you cannot have more than one of the same key. To fix this, you should modify your code like so:

    Dictionary<string, string> rct3Features = new Dictionary<string, string>();
    Dictionary<string, string> rct4Features = new Dictionary<string, string>();

    foreach (string line in rct3Lines)
    {
        string[] items = line.Split(new String[] { " " }, 2, StringSplitOptions.None);

        if (!rct3Features.ContainsKey(items[0]))
        {
            rct3Features.Add(items[0], items[1]);
        }

        ////To print out the dictionary (to see if it works)
        //foreach (KeyValuePair<string, string> item in rct3Features)
        //{
        //    Console.WriteLine(item.Key + " " + item.Value);
        //}

    }

The difference between == and === in jQuery/JavaScript

0 == false     // true
0 === false    // false, because they have different types (int, bool)
1 == "1"       // true
1 === "1"      // false, because they have different types (int, string)
null == undefined // true
null === undefined // false