0

I have an usual problem where my country lists are different for each of the environments I have.

My test environment is missing Cameroon and Hong Kong is Hong Kong SAR.

I'm using the following code to retrieve my countries:

var cultureInfo = CultureInfo.GetCultures(CultureTypes.SpecificCultures);

        foreach (var regionInfo in cultureInfo.Select(info => new RegionInfo(info.LCID)).Where(regionInfo => !cultureList.Contains(regionInfo.EnglishName)))
        {
                cultureList.Add(regionInfo.EnglishName);
        }

Any ideas what could be causing the discrepancies?

Thanks

gadgetgem
  • 63
  • 11

1 Answers1

0

Might want to read this answer Why not all countries are presented in CultureInfo.GetCultures()?.

Essentially it comes down to where the environments are located.

ObiEff
  • 640
  • 8
  • 24
  • Thanks for this, is there anyway to check what the culture is on a particular machine? – gadgetgem Jan 25 '18 at 09:23
  • Best way I can think of would be to run it in code and log the result somewhere, can do it using CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; – ObiEff Jan 25 '18 at 12:17