title: A circular reference was detected while serializing an object of type System.Globalization.CultureInfo
body: <p>I'm using jquery to call a webservice which returns a dataset with a couple of tables in it.</p>
  
  <p>This was working ok until i needed to set up my webmethod to accept a parameter. I reflected this on the client side with </p>
  
  <pre><code>data: "{paramname:'" + paramval+ "'}",
  </code></pre>
  
  <p>I now get the following error when the webmethod returns. This happens regardless of whats being returned in the dataset</p>
  
  <blockquote>
    <p>Error:{"Message":"A circular reference was detected while serializing
    an object of type
    \u0027System.Globalization.CultureInfo\u0027.","StackTrace":"   at
    System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object
    o, StringBuilder sb, Int32 depth, Hashtable objectsInUse,
    SerializationFormat serializationFormat)\r\n   at ...etc</p>
  </blockquote>
  
  <p>When the webmethod has no parameters the client side js looks the same as below except the data: line is removed.</p>
  
  <pre><code>function ClientWebService(paramval){
  $.ajax({
      type: "POST",
      url: "WebService1.asmx/webmethodName", 
      data: "{paramname:'" + paramval+ "'}",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function(msg) {
          ParseResult(msg.d);
      },
      error: function(err) {
          if (err.status == 200) {
                ParseResult(err);
          }
          else { alert('Error:' + err.responseText + '  Status: ' + err.status); }
      }
  }); 
  </code></pre>
  
  <p>}</p>
  
  <p>Edit: As per suggestion to change the request to  </p>
  
  <pre><code>data: {paramname: paramval},
  </code></pre>
  
  <p>yields the following error.</p>
  
  <blockquote>
    <p>Error:{"Message":"Invalid JSON primitive: paramval.","StackTrace":"<br>
    at
    System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()\r\n
    at
    System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32
    depth)\r\n   at
    System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String
    input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n   at
    System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer
    serializer, String input, Type type, Int32 depthLimit)\r\n   at
    System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String
    input)\r\n   at
    System.Web.Script.Services.RestHandler.GetRawParamsFromPostRequest(HttpContext
    context, JavaScriptSerializer serializer)\r\n   at
    System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData
    methodData, HttpContext context)\r\n   at
    System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext
    context, WebServiceMethodData
    methodData)","ExceptionType":"System.ArgumentException"}  Status: 500</p>
  </blockquote>