Options

Error: An item with the same key has a already been added.

bhalpinbhalpin Member Posts: 309
edited 2015-05-04 in NAV Three Tier
This is the 2nd time I've run into this and you would think I remembered the solution from last time. Not.

Using PowerShell Merge-NAVApplicationObject to do an upgrade I get the error:

Merge-NAVApplicationObject : An item with the same key has already been added.

When I was finished cursing whomever coded that error message for not including any clue as to the duplicated key [-X , I remembered I had run into this before and after a while remembered what causes it. So for future reference, this is what is happening.

There is a txt file in one of the folders that contains and object type & ID that has already been encountered in another file in that folder. In my example I had exported one large txt file containing thousands of objects and used a tool to split it into individual object files. But I had mistakenly left the large source file in with the individual files. So the first object in that big file appears as a duplicate of the individual file in the same folder.

I hope this is helpful.
Sign In or Register to comment.