JavaScript date serialization error in WCF POST Request

I have try to send an Ajax Post request from my client. So i am trying to send the DateTime format from client is like ’12/29/2014′ but my server accepts C# datetime. So i got an error like

There was an error deserializing the object of type ‘type’. DateTime content ’12/29/2014′ does not start with ‘\/Date(‘ and end with ‘)\/’ as required for JSON

How to resolve this error?

Write a javascript function like below
function ConvertToJsonDate(date) {
var convertedDate = new Date(date);
var str = Date.UTC(convertedDate.getFullYear(), convertedDate.getMonth(), convertedDate.getDate(), convertedDate.getHours(), convertedDate.getMinutes(), convertedDate.getSeconds(), 0);
var formattedDate = "\/Date(" + str + ")\/";
return formattedDate;

Convert your current date before sending request
var params = {
EndDate: ConvertToJsonDate(endDate),

Enjoy coding…

This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms



I have seen this error two times before when i try to build WPF and WindowsPhone application .I had a hard time with this issue.

How to resolve this error?

Open the Run window and type regedit 


Click OK and then Navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa 




DELETE this registry entry by right clicking the FipsAlgorithmPolicy folder and restart the application.It will resolve the issue