I'm working on a silverlight application where I'm checking the url to see if the user is trying to access the "Spanish" version. My methods work fine on Windows 7 and Windows Vista but I'm getting a crash throwing an Argument_InvalidCultureName exception when a user of Windows XP tries to load the application. Can someone look at the code below a give me perhaps an idea of what's going wrong and how to resolve it? Thanks in advance.
if (HtmlPage.Document.DocumentUri.Query.Contains("Spanish") || HtmlPage.Document.DocumentUri.Query.Contains("spanish") || HtmlPage.Document.DocumentUri.Query.Contains("Espanol"))
{
try
{
var culture = new CultureInfo("es-ES");
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
}
catch (Exception)
{
// Do Something
}
}