title: Getting "Recursive collection data contract" when referencing a WCF service with a slightly complex method
body: <p>If I use only simple methods in my WCF service, everything works fine. However, if I include the following method, a problem occurs:</p>
  
  <pre><code>[OperationContract]
  public List&lt;KeyValuePair&lt;string, string&gt;&gt; GetAllAccounts()
  {
      return AccountBusiness.GetAllAccounts();
  }
  </code></pre>
  
  <p>I get this error when referencing the service from another project:</p>
  
  <blockquote>
    <p>Warning   5   Custom tool warning: Cannot import wsdl:portType
        Detail: An exception was thrown while running a WSDL import extension:
    System.ServiceModel.Description.DataContractSerializerMessageContractImporter
        Error: <strong>Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract which is not supported</strong>. Consider modifying
    the definition of collection 'Newtonsoft.Json.Linq.JToken' to remove
    references to itself.
        XPath to Error Source: //wsdl:definitions[@targetNamespace='<a href="http://tempuri.org" rel="nofollow noreferrer">http://tempuri.org</a>']/wsdl:portType[@name='NodeService']   C:\inetpub\wwwroot\MyclientProject\Service
    References\NodeService\Reference.svcmap   1   1   MyClientNode</p>
  </blockquote>
  
  <p>If I remove the method above, recompile and update the reference, then it works fine. But when I add the above method, I consistently get this warning.</p>
  
  <p>One suggestion I found was to uninstall Visual Studio 2012 and repair Visual Studio 2010. I don't want to do that.</p>
  
  <p>Another <a href="https://stackoverflow.com/a/11128845/392362">suggested</a> to uncheck "Reuse types in all referenced assemblys", but this messes up the method signatures and is not usable.</p>