The Type JavaScriptSerializer is not defined RRS feed

  • Question

  • Hi,

    in my ASPX-page I'm importing the Namespace:

    Imports System.Web.Script.Serialization

    and then try to use the class:

    Dim Jsonconvert As New JavaScriptSerializer
    On my test server this causes no Problems, but on my production Server I get an error, stating that the type JavaScriptSerializer is not defined.

    Does anyone know how to fix this?

    Thursday, October 24, 2013 1:54 PM

All replies

  • Hi,

    Please try to check that you have added the following to your project:

        using System.Web;
        using System.Web.Script;
        using System.Web.Script.Serialization;

    Here is a similar thread, hope it can give your some idea:
    http://stackoverflow.com/questions/7000811/cannot-find-javascriptserializer-in-net-4-0 .

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 25, 2013 4:24 AM
  • Thanks for your suggestions. Unfortunately none of it helped. When I changed my project to target .NET Framework 4, I still couldn't add Version 4.0 of System.Web.Extension, because the System said that I have already referenced it. Explicitly removing it first doesn't seem to be possible either. And I still cannot comprehend why it works without problems on our testing server, as both machines seem to be configured identically.

    Friday, October 25, 2013 8:32 AM