Link to home
Start Free TrialLog in
Avatar of Member_2_5295610
Member_2_5295610

asked on

An Item with the same key has already been added.

one of the applications doesn´t work on Windows 10.
With langtest.exe we got info that
the error  giving the problem is "An Item with the same key has alreasy been added."
1: Name: ´ja-JP" DisplayName ´Japanese (Japan)´EnglishName ´Japanese (Japan)´
2: Name: ´ja-JP" DisplayName ´Japanese (Japan)´EnglishName ´Japanese (Japan)´

How I can fix this manually on  this  pc and remove one  or both of those keys?
Avatar of Member_2_5295610
Member_2_5295610

ASKER

To create the content packs list, the program is using Windows list of available languages (for instance to grab “Germany” from de-DE). So it will go and get all available (not only the one installed) to create a dictionary using the Name as the key. And as the exception states “An item with the same key has already been added”. So on that machine there is two or more languages (also called Cultures) available with the same name.

but how can I remove ja-JP  , one or both?
An item with the same key has already been added.

   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Cbg.Memoplus.DomainModel.CultureToNativeName..cctor()
Avatar of gr8gonzo
You would need to contact the developer. This is not a generic Windows problem - this is a problem that is specific to the application you're using, and can only be solved by the developer.
It is working for everyone else, so it is something about my PC or User settings.
Is there any possibility to delete ja-JP, and if yes, where  ?
That's the issue I'm referring to. There is a code issue. The fact that it works for everyone else simply means that there is something on your computer that the developer did not expect when he/she wrote the code.

This message is specific to a Dictionary<> object in a .NET application (e.g. likely C#).

It's typically against properly license to decompile an application to try to figure out what the problem is, so your best recourse is to explain what you're seeing to the developer and ask for help.

It might not be that you have 2 of the same language packs installed (usually Microsoft prevents that), but that the code that loads the language packs is running twice for some reason. There are many possible root causes in the code for this, and again, the developer would know for sure if you told him that you were seeing this message. He/she could run through the code and look for reasons that this would happen, and ideally provide an updated version.

If you're absolutely certain that it's due to having more than one Japanese language pack installed, you can always check this and remove it with Powershell. Run Powershell, then in the prompt, run:
Get-WinUserLanguageList

Open in new window


That should list the currently-installed languages on your PC.

If you see ja-JP listed twice, then you can remove it (or you can try removing it anyway and re-adding it later). To remove it, run these commands in Powershell:
$Langs = Get-WinUserLanguageList
$Japanese = $Langs | where LanguageTag -eq "ja-JP"
$Langs.Remove($Japanese)
Set-WinUserLanguageList $Langs -Force

Open in new window

Thank you I tried that but there is no language to be removed.
This fails on Power Shell.

The strange issue is that when I use admin credentials and start the application as admin,
it works!  
So  the issue is because something on the user account?
Very likely. Again, contact the developer.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.