SignalR/SignalR — Issue #95: JavaScriptSerializer Deserialize DateTime format exception
Author: meil
Created: 2011-12-07 20:33:04+00:00
State: open

When call hub server method from client with parameter object containing DateTime with value DateTime.Now, following exception happened on server when trying to use JavaScriptSerializer to deserialize the data extracted from Request.Form:

System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.ComponentModel.DateTimeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)

If change the DateTime value to DateTime.UtcTime, it works fine without any issue.
Please investigate this issue as we do want the local time to be passed to server.