.NET: String was not recognized as a valid DateTime
Posted: Tue Feb 25, 2014 10:14 am
Hello,
We're using the .NET API. Sometimes, when we hit CloudClientManager.GetDeviceInfo(HttpContext), we get this exception:
We believe this is due to the user's thread being in a special culture, such as Russian, and the date strings in that culture are not aligning with what your code expects.
However, as we can't see the source, we're just guessing.
We know we've seen this in ru-RU, but we think we've observed it in other cultures as well, including seemingly en-US.
Can you provide more information on what DateTime you're parsing, what formatinfo you're using to do the parse? Is there a fix on your end where you could use the invariant culture?
Thanks for any help.
We're using the .NET API. Sometimes, when we hit CloudClientManager.GetDeviceInfo(HttpContext), we get this exception:
Code: Select all
System.FormatException: String was not recognized as a valid DateTime
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ScientiaMobile.WurflCloud.Cache.CookieWurflCloudCache.GetDevice(HttpContextBase context)
at ScientiaMobile.WurflCloud.Http.CloudClient.SendRequest(HttpContextBase context, String url, Boolean uaMayBeDifferent)
However, as we can't see the source, we're just guessing.
We know we've seen this in ru-RU, but we think we've observed it in other cultures as well, including seemingly en-US.
Can you provide more information on what DateTime you're parsing, what formatinfo you're using to do the parse? Is there a fix on your end where you could use the invariant culture?
Thanks for any help.