none
CultureNotFoundException - 3072 (0x0c00) is an invalid culture identifier RRS feed

  • Question

  • Hi,

    I'm using

    Windows 10 64 bit operating system

    Visual Studio 2015.

    I am using English (Swaziland), “en-SZ”

    When I am running my program the current thread LCID is 3072.

    When I am trying to create new CultureInfo using current thread LCID 3072 (new CultureInfo(3072))

    I've got this error and I don't know how to solve it.

    Exception class: CultureNotFoundException

    Exception message:

    Culture is not supported.

    Parameter name: culture

    3072 (0x0c00) is an invalid culture identifier.

    How Do I solve this?


    Tuesday, September 5, 2017 11:39 AM

All replies

  • Hello, did you read the reason the exception was thrown (see link below)? Seems like the culture package is not available on the machine you are attempting to use it on. Where did you find the code? I don't see it in the list of available cultures for .NET

    https://msdn.microsoft.com/en-us/library/system.globalization.culturenotfoundexception%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites


    Tuesday, September 5, 2017 12:39 PM
    Moderator
  • Hello roypentagon,

    For CultureInfo.LCID Property , you will find some information from there.

    In most cases, the culture identifier is mapped to the corresponding NLS locale identifier.

    Almost all of the new locales in Windows are not assigned explicit LCIDs ,because there is not enough "room" for the thousands of languages in hundreds of countries problem. They all get assigned some certain LCID value.

    For your case , my suggestion is changing LCID to name , The following is my testing code:

    int LCID=0;
                string Name="";
                foreach (CultureInfo cultureInfo in CultureInfo.GetCultures(CultureTypes.AllCultures)) {
    
                    if (cultureInfo.Name == "en-SZ") {
    
                        Console.WriteLine(cultureInfo.LCID + "-------------" + cultureInfo.Name);
                        LCID = cultureInfo.LCID;
                        Name = cultureInfo.Name;
                    }
                }
    
    
                foreach (CultureInfo cultureInfo in CultureInfo.GetCultures(CultureTypes.AllCultures))
                {
    
                    if (cultureInfo.LCID == 3072)
                    {
    
                        Console.WriteLine(cultureInfo.LCID + "-------------" + cultureInfo.Name);
    
                    }
                }
    
                CultureInfo culture1 = new CultureInfo(Name);
    
                CultureInfo culture2 = new CultureInfo(LCID);
    

    Best regards,

    feih_7


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, September 6, 2017 9:18 AM
    Moderator