locked
JavaScriptSerializer().Serialize returning different results on different machines RRS feed

  • Question

  • User1583078828 posted

    Hello,

    We have a problem with a web application which uses JavaScriptSerializer().Serialize to encode a JSON string. We get different results on our Test and Production Servers.

    We thought it was due to the version of System.Web.Extensions which were different on each machine.

    Test 3.5.30729.5446

    Prod. 3.5.30729.5458

    but after synchronizing these versions on both machines we still get different results.

    I wrote a WPF app which outputs the results. This is the exact line of code I am using.

    newJavaScriptSerializer().Serialize(HttpUtility.HtmlEncode(txtHTML.Text));

    The result on Test when a " is entered in txtHTML.text is: \u0026quot;

    The result on Production when a " is entered in txtHTML.text is: "

    Does anyone have any idea why this may be?

    thanks,

    sivilian

    Monday, December 2, 2013 9:47 AM

Answers

  • User1583078828 posted

    I think you are right about that. Nevertheless, the issue has been resolved.. The .NET Framework 4.5 was not installed on the production server.

    many thanks,

    sivilian

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 2, 2013 3:18 PM

All replies

  • User-231977777 posted

    Hi,

    Your problem is in Encoding not is Serialization.

    Monday, December 2, 2013 2:35 PM
  • User1583078828 posted

    I think you are right about that. Nevertheless, the issue has been resolved.. The .NET Framework 4.5 was not installed on the production server.

    many thanks,

    sivilian

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 2, 2013 3:18 PM