Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve this Exception "Culture is not Supported"?

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?

like image 876
mohamed hafil Avatar asked Mar 02 '17 11:03

mohamed hafil


2 Answers

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)

like image 99
kizza samuel Avatar answered Nov 10 '22 07:11

kizza samuel


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.

like image 2
Nyerguds Avatar answered Nov 10 '22 07:11

Nyerguds