Page 1 of 1

.NET: String was not recognized as a valid DateTime

Posted: Tue Feb 25, 2014 10:14 am
by cspace
Hello,

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)
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.

Re: .NET: String was not recognized as a valid DateTime

Posted: Tue Feb 25, 2014 5:14 pm
by Elliotfehr
Hello,

We have our .NET engineers looking into this along with your other forum post at the moment and we will let you know as soon as there is an update. Thank you for your patience.

Elliot

Re: .NET: String was not recognized as a valid DateTime

Posted: Wed Feb 26, 2014 10:29 am
by Elliotfehr
Hello,

I am going to email you an updated cloud client for you to try out that should fix the issue that you are having. Feel free to let me know if the issue persists.

Thank you,

Elliot

Re: .NET: String was not recognized as a valid DateTime

Posted: Mon Mar 10, 2014 11:01 am
by cspace
Hi!

We released this patch to production this morning and have actually seen a big uptick in this exception in our logs after deploying the patch. Is there any information that we can send to you to help you guys debug the issue further?

Re: .NET: String was not recognized as a valid DateTime

Posted: Fri Mar 14, 2014 10:28 am
by Elliotfehr
Hello,

I wanted to check in with you to see if the builds that we sent over to you earlier in the week to debug this issue worked?

Thank you,

Elliot

Re: .NET: String was not recognized as a valid DateTime

Posted: Mon Mar 24, 2014 12:26 pm
by uci2i
Hi,
we're seeing this error too.
We can recreate it by changing the browser culture, so we assume it's due to dates being stored (cookie?) in 1 format and then read in another.

Is there an updated version we can try?
Thanks

Re: .NET: String was not recognized as a valid DateTime

Posted: Mon Mar 24, 2014 2:02 pm
by Elliotfehr
uci2i,

I just sent you an email with a possible patch for this issue. Feel free to let me if this does not solve the issue for you.

Thank you,

Elliot