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

1 Answer 1

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.

2
  • Thanks for this, is there anyway to check what the culture is on a particular machine?
    – gadgetgem
    Jan 25, 2018 at 9: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, 2018 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.