2

I am trying to find the ThreeLetterISORegionName of country "Cyprus" and "Virgin Islands". hence so I have used RegionInfo class using System.Globalization from mscorlib assembly.

RegionInfo regionInfo = new RegionInfo("CY");
Console.WriteLine(regionInfo.ThreeLetterISORegionName);

The above code works fine in my local machine. however after deploying to production I am getting System.ArgumentException with message

The region name CY should not correspond to neutral culture; a specific culture name is required

In my local machine and server I am using .net 4.5.2 version. mscorlibv assembly version is 4.0.30319

Any help is much appreciated. :)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Mona
  • 342
  • 1
  • 3
  • 17
  • 2
    sounds like this https://stackoverflow.com/questions/2920274/missing-countries-locations-from-cultureinfo-when-trying-to – TiGreX Jun 30 '18 at 08:34
  • Are you deploying to Azure? Not all cultures are supported on Azure App Services. See https://social.msdn.microsoft.com/Forums/en-US/963f02d1-bf04-430a-ab51-9c3fc0462e63/cultures-not-supported-on-azure-webapps?forum=windowsazurewebsitespreview – Rui Jarimba Jun 30 '18 at 08:42
  • @RuiJarimba : Nope not azure. – Mona Jun 30 '18 at 08:45

1 Answers1

1

Later I found the root cause of this problem.

My local machine is Windows 10 which has the updated region info.

where my server OS is windows server 2008 which doesnt have region information on cyprus or Virgin Islands

Mona
  • 342
  • 1
  • 3
  • 17