My Asp.Net MVC application targets .Net Framework 4.6.1
In my dev environment, this works:
var x = new CultureInfo("xx")
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4210.0 (I got this info from a random error page, elsewhere in the same MVC application, it's mentioned at the bottom)
IIS 10.0.18362.650 on Windows 10 build 18363.1016 (info gotten from IIS manager - help - about)
On a hosted staging (and live) environment, the same code throws an exception
[CultureNotFoundException: Culture is not supported.
Parameter name: name
xx is an invalid culture identifier.]
System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) +230
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.3928.0 IIS 8.5.9600.16384 on Windows Server 2012 R2
I'm aware that "xx" isn't a valid culture (I just used it to compare resources files in different languages, and needed a non existing culture). But what I want to know is why this fails on one environment and works on another. The asp.net versions are (almost) the same.