9

When I upload my ASP.Net site on IIS in my server, It throws the following error

Error

Culture is not supported. Parameter name: name en-SA is an invalid culture identifier. Exception Details: System.Globalization.CultureNotFoundException: Culture is not supported. Parameter name: name en-SA is an invalid culture identifier.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[CultureNotFoundException: Culture is not supported. Parameter name: name en-SA is an invalid culture identifier.] System.Globalization.CultureInfo.GetCultureInfo(String name) +14364298 WebApplication3.UserHomePage.getHourChart1001() +369 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209`

I saw so many pages on stack over flow regarding this issues. Some of them suggest to delete the file on this location

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

There is no files or folders inside Temporary ASP.NET Files.

What is the issue?

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
mohamed hafil
  • 209
  • 2
  • 5
  • 11

6 Answers6

7

I faced the same issue in my Windows 10 pro installation. Turns out Regional Format settings had be set by default to my country; English(Uganda).

To solve this in Windows 10, go to; Region -> Regional format -> English (United States)

kizza samuel
  • 71
  • 1
  • 2
3

I had the problem too, on Windows 10, and after some searching I found the solution here.

It seems something in the .Net framework tries to resolve your currently set UI culture. If the UI language is set differently from the keyboard, this seems to cause windows to compose its own culture string, of the format "interface language-keyboard language". I had the same problem with "en-be".

The solution is to set your region to something the .Net framework recognizes in the older Win7-style region settings screen. A search for "region" through the start menu should get you there.

In that screen, select a valid existing region, and then adjust your detail date/time format settings as you want them. It should not affect the actual language or keyboard settings, and it should solve the problem.

Nyerguds
  • 5,360
  • 1
  • 31
  • 63
2

Actually, there is no problem, Windows 10 enhanced with a new Culture = "English (Europe)", with Locale ID = "3072", before 5 months ago, and therefore if your regional settings are configured to this by default you may experience problems with Internet Information Services, SQL Server, SQL Server Management Studio, SDKs, etc, which does not yet support this culture.

To resolve this, navigate to:

Control Panel -> Region -> Regional format -> English (United States)

Stavros Koureas
  • 1,126
  • 12
  • 34
0

If you look at the list of defined locales, en-SA is not listed there. Is just an invalid locale! In your aspx, it could look like:

<%@ Page Culture="en-SA" %>

Search your project where you have used en-SA and correct this.

What does the culture setting do?

The manual says:

The CultureInfo object that is returned by this property and its associated objects determine the default format for dates, times, numbers, currency values, the sorting order of text, casing conventions, and string comparisons.

So if you want an Egypt locale (meaning egypt numbers, currency values and sorting), you could use ar-EG, for example.

ventiseis
  • 3,029
  • 11
  • 32
  • 49
  • Actually, I got this problem after setting my PC to English with Belgian keyboard. Somehow, this made the .Net framework use the culture "en-be" for... something in the build, and that is failing it. My project doesn't contain any references to this – Nyerguds Dec 13 '17 at 09:35
0

Just add Local before reading Presentation, like:

Locale.setDefault(new Locale("en-us"));
Presentation pres = new Presentation("yourfile.pptx");
Hungnn
  • 68
  • 1
  • 2
  • 19
-1

Got it solved by removing too many language preferences from the list.

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 11 '21 at 15:59