Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont work #19

Open
tohoff82 opened this issue Dec 13, 2019 · 2 comments
Open

Dont work #19

tohoff82 opened this issue Dec 13, 2019 · 2 comments

Comments

@tohoff82
Copy link

System.ArgumentException: An item with the same key has already been added. Key: TYPE
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at MixERP.Net.VCards.Parser.TokenParser.GetAdditionalKeyMembers(String data) at MixERP.Net.VCards.Parser.TokenParser.GetToken(String line) at MixERP.Net.VCards.Parser.TokenParser.Parse(String contents) at MixERP.Net.VCards.Deserializer.GetVCard(String contents) at System.Linq.Enumerable.SelectArrayIterator2.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at MixERP.Net.VCards.Deserializer.GetVCards(String contents)

@DasMaffin
Copy link

My fix was extracting it and putting a try catch around the dictionary.Add(key, value) in the method VCardUtil.GetAdditionalKeyMembers
Its everything else but beautiful but it makes it work

@kiquenet
Copy link

kiquenet commented Feb 5, 2021

I use Nuget, and I get: System.ArgumentException: An item with the same key has already been added.

Which is the key ?

IEnumerable vcards = MixERP.Net.VCards.Deserializer.Deserialize(vcfMovil);

        string contents = File.ReadAllText(vcfMovil, Encoding.UTF8);
        IEnumerable<VCard> vcards2 = MixERP.Net.VCards.Deserializer.GetVCards(contents);

        foreach (var vcard in vcards2)
        {
            Console.WriteLine(vcard.FirstName + " \t " + vcard.MiddleName + " " + vcard.LastName);
            Console.WriteLine(vcard.FormattedName);
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants