0

I have application which use culture Where I do

var culture = new CultureInfo(code); // code can be en-GB, en-US etc...

When I try with en-ZM I am getting below error

Culture is not supported. Parameter name: name en-ZM is an invalid culture identifier

This works fine in my development PC but not in some other remote machine(Windows server 2012R2)

When I check do

CultureInfo.GetCultures(CultureTypes.AllCultures)

the count I get is different in my pc and remote machine.

Is there a way I can add these missing culture?

stuartd
  • 70,509
  • 14
  • 132
  • 163
unknown
  • 203
  • 1
  • 7
  • The returned cultures are those that are installed on the windows, they are not gaurenteed to be the same across O/S installs. – Igor Jan 14 '19 at 17:36
  • Off of Igors comment, see the remarks section in the documentation: https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.getcultures?view=netframework-4.7.2#remarks – Broots Waymb Jan 14 '19 at 17:37
  • @Igor: Yes its same. Checked it in `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP` and both are same – unknown Jan 14 '19 at 17:40
  • That is the .net version, **not** the O/S version which is what I am talking about. – Igor Jan 14 '19 at 17:41
  • Check HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\ExtendedLocale is present in remote server registry? – Sonal Borkar Jan 14 '19 at 17:42
  • @SonalBorkar: Yes it is – unknown Jan 14 '19 at 17:52

0 Answers0