Culture is not supported.\r\nParameter name: name\r\nxx-XX is an invalid culture identifier.

Jun 13, 2013 at 5:12 AM
This is possibly a bug in 1.6. I can reproduce it by doing the following:

-Create a new site
-Add a custom culture (xx-XX in this case)
-Add the Culture Picker and select the xx-XX culture

At this point the xx-XX culture is stored as the default culture in a browser cookie.

Now to make it crash:
-Delete the database and everything in the Orchard.Web\App_Data folder
-Run it, regenerating everything with the default recipe
-Add the Culture Picker
-Go to Your Site

I get the exception:
Server Error in '/OrchardLocal' Application.

Culture is not supported.
Parameter name: name
xx-XX is an invalid culture identifier.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

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

Source Error: 


Line 26:             T = NullLocalizer.Instance;
Line 27: 
Line 28:             _cultureInfo = new Lazy<CultureInfo>(() => CultureInfo.GetCultureInfo(_workContextAccessor.GetContext().CurrentCulture));
Line 29:         }
Line 30: 

Source File: c:\TFSRoot\CatalogueOrchardPrototype\src\Orchard.Web\Core\Shapes\DateTimeShapes.cs    Line: 28 

Stack Trace: 


[CultureNotFoundException: Culture is not supported.
Parameter name: name
xx-XX is an invalid culture identifier.]
   System.Globalization.CultureInfo.GetCultureInfo(String name) +10700950
   Orchard.Core.Shapes.DateTimeShapes.<.ctor>b__0() in c:\TFSRoot\CatalogueOrchardPrototype\src\Orchard.Web\Core\Shapes\DateTimeShapes.cs:28
   System.Lazy`1.CreateValue() +180
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +22
   System.Lazy`1.get_Value() +10786397
   Orchard.Core.Shapes.DateTimeShapes.DateTime(DateTime DateTimeUtc, LocalizedString CustomFormat) in c:\TFSRoot\CatalogueOrchardPrototype\src\Orchard.Web\Core\Shapes\DateTimeShapes.cs:73
   Orchard.Core.Shapes.DateTimeShapes.DateTime(DateTime DateTimeUtc, LocalizedString CustomFormat) in c:\TFSRoot\CatalogueOrchardPrototype\src\Orchard.Web\Core\Shapes\DateTimeShapes.cs:70
Oct 24, 2014 at 7:15 AM
BenPower wrote:
This is possibly a bug in 1.6. I can reproduce it by doing the following:

-Create a new site
-Add a custom culture (xx-XX in this case)
-Add the Culture Picker and select the xx-XX culture

At this point the xx-XX culture is stored as the default culture in a browser cookie.

Now to make it crash:
-Delete the database and everything in the Orchard.Web\App_Data folder
-Run it, regenerating everything with the default recipe
-Add the Culture Picker
-Go to Your Site

I get the exception:
Server Error in '/OrchardLocal' Application.

Culture is not supported.
Parameter name: name
xx-XX is an invalid culture identifier.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

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

Source Error: 


Line 26:             T = NullLocalizer.Instance;
Line 27: 
Line 28:             _cultureInfo = new Lazy<CultureInfo>(() => CultureInfo.GetCultureInfo(_workContextAccessor.GetContext().CurrentCulture));
Line 29:         }
Line 30: 

Source File: c:\TFSRoot\CatalogueOrchardPrototype\src\Orchard.Web\Core\Shapes\DateTimeShapes.cs    Line: 28 

Stack Trace: 


[CultureNotFoundException: Culture is not supported.
Parameter name: name
xx-XX is an invalid culture identifier.]
   System.Globalization.CultureInfo.GetCultureInfo(String name) +10700950
   Orchard.Core.Shapes.DateTimeShapes.<.ctor>b__0() in c:\TFSRoot\CatalogueOrchardPrototype\src\Orchard.Web\Core\Shapes\DateTimeShapes.cs:28
   System.Lazy`1.CreateValue() +180
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +22
   System.Lazy`1.get_Value() +10786397
   Orchard.Core.Shapes.DateTimeShapes.DateTime(DateTime DateTimeUtc, LocalizedString CustomFormat) in c:\TFSRoot\CatalogueOrchardPrototype\src\Orchard.Web\Core\Shapes\DateTimeShapes.cs:73
   Orchard.Core.Shapes.DateTimeShapes.DateTime(DateTime DateTimeUtc, LocalizedString CustomFormat) in c:\TFSRoot\CatalogueOrchardPrototype\src\Orchard.Web\Core\Shapes\DateTimeShapes.cs:70